获取从gnuplot到c++的变量
我正在用C ++编写一个代码,该代码使用GNUPLOT绘制数据集,并且我意识到,如果我可以将变量从GNUPLOT获取到我的C ++代码,则可以简化代码。例如,如果我做了一个合适的f并获得他的统计信息
f(x)=a*x+b
fit f 'data.txt' via a,b
stats 'data.txt' u (f($1)):2 name 'Sf'
,即有任何方法可以获取sf_records并将其保存到我的代码中的变量中?喜欢int n = rf_records
?
感谢您的帮助
I'm writing a code in c++ which plots a dataset using gnuplot, and I realized that I could simplify my code a lot if I could get variables from gnuplot to my c++ code. e.g. if I did a fit f and get his stats i.e.
f(x)=a*x+b
fit f 'data.txt' via a,b
stats 'data.txt' u (f($1)):2 name 'Sf'
Is there any way to get, for example, the Sf_records and save it to a variable in my code? Like int N = Rf_records
?
Thanks for your help
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
假设您正在与
gnuplot
trougth afifo
进行通信,则可以订购gnuplot,并且可以将其读取给您的
c ++
program。例如。要读取差异:
打开
gnuplot
fifo
Assuming that you are communicating with
gnuplot
trougth aFIFO
, you can order to gnuplotand you can read this to your
c++
program.Eg. for reading a varirable:
To open a
gnuplot
FIFO