matlab的lsqcurvefit函数做幂函数拟合出错幂函数拟合 错误提示是ydata和函数输出维数不一样(Function value and YDATA sizes are incommensurate),希望各位验证后再给出答案,function F=mihanshu(x,a)F=a(1)*(x.^a(2));

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/30 05:11:28
matlab的lsqcurvefit函数做幂函数拟合出错幂函数拟合 错误提示是ydata和函数输出维数不一样(Function value and YDATA sizes are incommensurate),希望各位验证后再给出答案,function F=mihanshu(x,a)F=a(1)*(x.^a(2));
xRJQ~-lv٠P`aW\Htd㕊h6B[U49'W(^J|9̙o&_/0bytUVp[cs!q9Ϣ; PhɃ@xߚ_~ ~{__~_7IPVx"̿{=E~PYռ JB]M[G^ƽ M]-e.5h9QR բ W_(CU_a?ڟО?>&a5Rd1pg6p|1:wrg,Xn@h9[ lвmB'G<[a6K5t4Й M~[WB-)w-iȴTkPz!Ys{:R5nz;

matlab的lsqcurvefit函数做幂函数拟合出错幂函数拟合 错误提示是ydata和函数输出维数不一样(Function value and YDATA sizes are incommensurate),希望各位验证后再给出答案,function F=mihanshu(x,a)F=a(1)*(x.^a(2));
matlab的lsqcurvefit函数做幂函数拟合出错
幂函数拟合 错误提示是ydata和函数输出维数不一样(Function value and YDATA sizes are incommensurate),希望各位验证后再给出答案,
function F=mihanshu(x,a)
F=a(1)*(x.^a(2));
x=[50 88 103 119 127 138 151 160 169 178 186 195 ];
y=[0.002 0.058 0.115 0.231 0.346 0.577 0.866 1.155 1.443 1.732 2.021 2.31];
a0=[1 2];
[a,res]=lsqcurvefit(@mihanshu,a0,x,y);

matlab的lsqcurvefit函数做幂函数拟合出错幂函数拟合 错误提示是ydata和函数输出维数不一样(Function value and YDATA sizes are incommensurate),希望各位验证后再给出答案,function F=mihanshu(x,a)F=a(1)*(x.^a(2));
把function F=mihanshu(x,a)
改为
function F=mihanshu(a,x)