作业帮 > 综合 > 作业

matlab 中fit函数怎么用?求例子

来源:学生作业帮 编辑:神马作文网作业帮 分类:综合作业 时间:2024/10/04 16:23:41
matlab 中fit函数怎么用?求例子
matlab 中fit函数怎么用?求例子
看matlab自己的例子,help里边例子很丰富哈~~~
load censusplot(cdate,pop,'o')hold ons = fitoptions('Method','NonlinearLeastSquares',...               'Lower',[0,0],...               'Upper',[Inf,max(cdate)],...               'Startpoint',[1 1]);f = fittype('a*(x-b)^n','problem','n','options',s);[c2,gof2] = fit(cdate,pop,f,'problem',2);[c3,gof3] = fit(cdate,pop,f,'problem',3);plot(c2,'m')plot(c3,'c')

画出的图来: