如何在gnuplot中将函数与多个文件配合使用 [英] How to fit a function with multiple files in gnuplot

查看:102
本文介绍了如何在gnuplot中将函数与多个文件配合使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想对gnuplot中的多个文件使用fit命令。
我知道对于一个文件,该命令例如:

I would like to use the fit command for multiple files in gnuplot. I know that for one file the command is for example:

f(x)=a*x+b
fit f(x) 'file1' u ($18/-200):($4/200)  via a, b

现在我希望有多个文件( file1, file2, file3等),而不是单个文件,并找到适合所有数据集的最佳a,b参数。

Now instead of a single file I would like to have multiple ones ('file1','file2','file3'etc.) and find the best a, b, parameters that fit all data sets.

此问题与此一个,但文件不同。

This question is similar to this one but with different files.

谢谢!

推荐答案

就像您链接的问题一样在这里,您必须将所有文件合并为一个文件。您可以使用例如命令行工具 cat 即时执行此操作:

Like in the question you linked, also here you must combine all files to a single one. You can use e.g. the command line tool cat to do this on-the-fly:

f(x) = a*x + b
fit f(x) '< cat file1 file2 file3' using ($18/-200):($4/200) via a,b

这篇关于如何在gnuplot中将函数与多个文件配合使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆