我想在MATLAB中做以下,
global a b c d e f g h l;
A=[1 3;3 2];
B=[a 0;0 b];
C=[d 0;e f];
Ctranspose=transpose(C);
D=[sqrt(d) 0;0 sqrt(f)];
E=Ctranspose/D;
Etranspose=transpose(E);
K=A+E;
M=E*D*Etranspose;
for a=1:10
for b=1:10
if K==M
print(a);
print(b);
print(d);
print(e);
print(f);
end
end
end
Run Code Online (Sandbox Code Playgroud)
我收到以下错误:
一个)
Run Code Online (Sandbox Code Playgroud)Error using + Matrix dimensions must agree. Error in trial (line 6) K=A+B
b)
Run Code Online (Sandbox Code Playgroud)Error using vertcat CAT arguments dimensions are not consistent. Error in trial (line 5) C=[d 0;e f];
这有什么不对?
(请注意,我是MATLAB的新手)
谢谢