matlab程序运行总是出现? Error using ==> sym.mpower Matrix must be square. 加了“.”还是不行呀m=zeros(1,50);a=zeros(1,50);b=zeros(1,50);f0=zeros(1,50); syms d x1 x2 e; m(1)=1;c=
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/26 08:39:43
matlab程序运行总是出现? Error using ==> sym.mpower Matrix must be square. 加了“.”还是不行呀m=zeros(1,50);a=zeros(1,50);b=zeros(1,50);f0=zeros(1,50); syms d x1 x2 e; m(1)=1;c=
matlab程序运行总是出现? Error using ==> sym.mpower Matrix must be square. 加了“.”还是不行呀
m=zeros(1,50);a=zeros(1,50);b=zeros(1,50);f0=zeros(1,50);
syms d x1 x2 e;
m(1)=1;c=10;a(1)=0;b(1)=0;
f=16*x1+60*x2+e.*((2.667*x1.^2+30*x1.*x2-2285714.286).^2+(1.333*x1.^3+15*x1.^2.*x2-1677669903).^2); f0(1)=281458000000000000;
fx1=diff(f,'x1');
fx2=diff(f,'x2');
for k=1:100
x1=a(k);x2=b(k);e=m(k);
for n=1:100
f1=subs(fx1);
f2=subs(fx2);
if(double(sqrt(f1^2+f2^2))
matlab程序运行总是出现? Error using ==> sym.mpower Matrix must be square. 加了“.”还是不行呀m=zeros(1,50);a=zeros(1,50);b=zeros(1,50);f0=zeros(1,50); syms d x1 x2 e; m(1)=1;c=
dd=solve(Dd); x1=x1-dd.*f1; x2=x2-dd.*f2;
dd不止一个根,所以新生成的x1,x2就不是两个数字了,而是两个矩阵,之后:
f1=subs(fx1);
f2=subs(fx2);
f1,f2也变成矩阵,所以说
if(double(sqrt(f1^2+f2^2))