Printing 将拟合结果打印到Gnuplot中的终端

Printing 将拟合结果打印到Gnuplot中的终端,printing,gnuplot,Printing,Gnuplot,我想完成一项非常简单的任务,这是我自己无法完成的。我想使用拟合参数,例如a1、a2、a3,对其进行一些基础数学运算,并将结果作为简单输出打印到我的终端(如cout“Hello World”) 我希望Gnuplot中有这样的内容: print 'the result C = a0+a1+a2' 以及类似的输出(例如,如果所有参数均等于1) 非常感谢您提前使用sprintf根据一些变量格式化字符串: print sprintf('the result is C = %.2f', a0 + a1 +

我想完成一项非常简单的任务,这是我自己无法完成的。我想使用拟合参数,例如a1、a2、a3,对其进行一些基础数学运算,并将结果作为简单输出打印到我的终端(如cout“Hello World”)

我希望Gnuplot中有这样的内容:

print 'the result C = a0+a1+a2'
以及类似的输出(例如,如果所有参数均等于1)


非常感谢您提前

使用
sprintf
根据一些变量格式化字符串:

print sprintf('the result is C = %.2f', a0 + a1 + a2)

如果还需要错误,请执行以下操作:

set fit errorvariables
fit ...
print sprintf(' a0 has been determined to %d  +/- %d', a0, a0_err)

由于使用了
设置拟合
命令,拟合后每个变量都会有一个额外的变量
*\u err“

完成了此工作。谢谢:-)
set fit errorvariables
fit ...
print sprintf(' a0 has been determined to %d  +/- %d', a0, a0_err)