MATLAB中nlinfit函数,老是报错什么mtimes Inner matrix dimensions must agree.x=[59388.341\x0545924.931\x054.00559388.342\x0545924.933\x053.99659388.344\x0545924.928\x053.99159388.327\x0545924.922\x053.96559388.335\x0545924.927\x053.96559388.334
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/28 08:21:39
MATLAB中nlinfit函数,老是报错什么mtimes Inner matrix dimensions must agree.x=[59388.341\x0545924.931\x054.00559388.342\x0545924.933\x053.99659388.344\x0545924.928\x053.99159388.327\x0545924.922\x053.96559388.335\x0545924.927\x053.96559388.334
MATLAB中nlinfit函数,老是报错什么mtimes Inner matrix dimensions must agree.
x=[59388.341\x0545924.931\x054.005
59388.342\x0545924.933\x053.996
59388.344\x0545924.928\x053.991
59388.327\x0545924.922\x053.965
59388.335\x0545924.927\x053.965
59388.334\x0545924.926\x053.977
59388.331\x0545924.926\x053.98
59388.327\x0545924.925\x053.977
59388.27\x0545924.913\x053.979
59388.104\x0545924.882\x053.967
59387.982\x0545924.857\x053.958
59387.758\x0545924.815\x053.968
59387.331\x0545924.735\x053.957
59386.102\x0545924.504\x053.962
59384.013\x0545924.12\x053.965
59381.124\x0545923.592\x054.048
59377.409\x0545922.887\x054.054
59373.111\x0545922.12\x054.065
59368.436\x0545921.321\x054.081
59363.499\x0545920.461\x054.092
59358.231\x0545919.51\x054.132
59352.606\x0545918.416\x054.123
59346.602\x0545917.199\x054.264
59340.039\x0545915.811\x054.353
59333.074\x0545914.302\x054.4
59325.856\x0545912.772\x054.376
59318.547\x0545911.3\x054.362
59311.241\x0545909.938\x054.285
59303.925\x0545908.683\x054.242
59296.578\x0545907.474\x054.186
59289.24\x0545906.218\x054.048
59281.988\x0545904.954\x054.126
];X=x1(:,1:2);z=x1(:,3);
f=@(p,X) p(1)*X(:,1).^2+p(2)*X(:,2).^2+p(3)*X(:,1)*X(:,2)+p(4)*X(:,1)+p(5)*X(:,2)+p(6);p0=[1 1 1 1 1 1];
p=nlinfit(X,z,f,p0);
这是错在哪里,怎么出不来结果?
MATLAB中nlinfit函数,老是报错什么mtimes Inner matrix dimensions must agree.x=[59388.341\x0545924.931\x054.00559388.342\x0545924.933\x053.99659388.344\x0545924.928\x053.99159388.327\x0545924.922\x053.96559388.335\x0545924.927\x053.96559388.334
Error using ==> mtimes Inner matrix dimensions must agree.请问是什么原因?那个向量的维数不一致了?x 要用点乘