作业帮 > 综合 > 作业

matlab 非线性拟合 求指导 MODELFUN should return a vector of fitted v

来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/05/09 14:53:39
matlab 非线性拟合 求指导 MODELFUN should return a vector of fitted values the same length as Y.
>> x=[1.4142 5.3852 6.0828 6.0828 7.2801 9.2195 9.2195 13.1529 14.4222 18.4391];
y=[15.8 16.7 9.6 13.1 13.5 17.1 17.2 15.8 25.8 30.1];
beta0=[30 -0.1];
[beta,r,j]=nlinfit(x,y,@fun,beta0);
beta
ci=nplarci(beta,r,j)
nlintool(x,y,fun,beta0,0.05,'x','y')
Error using ==> nlinfit at 127
MODELFUN should return a vector of fitted values the same length as Y.
你的X和Y的数据点数不一样多,要一致才能拟合的.
再问: 不明白,求修正