matlab的lsqcurvefit函数做幂函数拟合出错幂函数拟合 错误提示是ydata和函数输出维数不一样(Function value and YDATA sizes are incommensurate),希望各位验证后再给出答案,function F=mihanshu(x,a)F=a(1)*(x.^a(2));
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/17 06:26:43
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)