matlab中,有一组数据,date001,..date277,如何用循环函数对它们挨个使用lsqcurvefit进行非线性拟合?

正常对其中一个进行拟合就是
fun= xxxxxx(拟合函数)
p01 = lsqcurvefit(fun,x0,x,data001)
这种形式,但是如何将其写进循环函数让它能轮流循环处理几百个函数?

已知有date001,..date277等数据,如何用循环函数对它们挨个使用lsqcurvefit进行非线性拟合?实现思路:

如date001,..date277等数据是储存在mydate.xls中,则

A=xlsread('mydate.xls')

[m,n]=size(A) %这里行是每列的数据,列分别为date001,date002,..date277

x=1:m %暂设(因题主没有提起)

for i=1:n

data0=A(:,i)

fun= xxxxxx(拟合函数)

p0 = lsqcurvefit(fun,x0,x,data0)

p(i,:)=p0; %拟合系数b保存在p变量中

disp(['数据:',num2str(1)])

disp(p0)

end

数据结构形式。

温馨提示:答案为网友推荐,仅供参考
相似回答