【问题标题】:How to make gnuplot give you the coefficients of a data fit如何让 gnuplot 为您提供数据拟合的系数
【发布时间】:2015-02-20 08:03:05
【问题描述】:

我正在使用 gnuplot 将数据拟合到具有未知系数的某个函数。我可以让 gnuplot 绘制拟合函数,但我不知道如何让 gnuplot 给我该函数的实际方程。

主要命令是:

f(x) = a/(1+(b*(x-c)*(x-c)))
a=80
b=.001
c=70
fit f(x) "data.dat" using 1:2:3 via a,b,c

我想让 gnuplot 告诉我它为 a b 和 c 得出的值。或者我可能误解了这个命令,它实际上使用了我作为 a、b 和 c 插入的值。有谁可以帮我离开这里吗?

【问题讨论】:

    标签: plot gnuplot data-fitting


    【解决方案1】:

    拟合后的值存储在各自的变量abc

    f(x) = a/(1+(b*(x-c)*(x-c)))
    a=80
    b=.001
    c=70
    fit f(x) "data.dat" using 1:2:3 via a,b,c
    
    print a, b, c
    
    plot "data.dat" w p, f(x) title sprintf("a=%e, b=%e, c=%e", a, b, c)
    

    【讨论】:

      猜你喜欢
      • 2013-11-23
      • 2014-07-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多