相关疑难解决方法(0)

这个MATLAB代码有什么问题?

我想在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)

我收到以下错误:

一个)

Error using  + 
Matrix dimensions must agree.

Error in trial (line 6)
K=A+B
Run Code Online (Sandbox Code Playgroud)

b)

Error using vertcat
CAT arguments dimensions are not consistent.

Error in trial (line 5)
C=[d 0;e f];
Run Code Online (Sandbox Code Playgroud)

这有什么不对?

(请注意,我是MATLAB的新手)

谢谢

matlab concatenation dimensions

3
推荐指数
1
解决办法
814
查看次数

标签 统计

concatenation ×1

dimensions ×1

matlab ×1