matlab画散点图并拟合函数曲线 MATLAB画散点图和二次函数
www.zhiqu.org 时间: 2020-12-07
画法如下:
在输入栏分别输入x=[...............],y=[.........................]
matlab的开始菜单start->toolboxes->cirve
fitting->cirve
fitting
tool,
点data选择x和y数据,对应自己的数据,点cirve
fitting
tool界面的fitting按钮,里面好几个可以拟合的函数。可以自动生成曲线,得到系数,分析误差。
我个人认为你可以照着下面做:%
by
dynamic
of
matlab技术论坛%
see
also
href="http://wenda.so.com/index/verifyurl?url=http%3a%2f%2fwww.matlabsky.coms=
';
beta=[ones(19,1),log(s)]\log(n);s=180:275;n=exp(beta(1)+beta(2)*log(s));semilogx(n,s,'o',n,s)xlabel('n')ylabel('s')title(['lgn=',num2str(beta(1)),'+(',num2str(beta(2)),')*lgs'])