disp('(a) Solution by mesh analysis')
VL=360*sqrt(3); % Line voltage magnitude
Zs=j*24; Zm=j*6; % Series and mutual impedances
Z= [(Zs-Zm) -(Zs-Zm) 0;
0 (Zs-Zm) -(Zs-Zm); % Matrix from 2 mesh equations
1 1 1 ]; % and one node equation
V=[VL*cos(pi/6)+j*VL*sin(pi/6); % RHS of mesh node equations
VL*cos(-pi/2)+j*VL*sin(-pi/2);
0 ];
Iabc=Z\V; % Line currents, Rectangular
Iabcp=[abs(Iabc), angle(Iabc)*180/pi] % Line currents, polar
Error using horzcat
Dimensions of matrices being concatenated are not consistent.
Error in S10Q6 (line 4)
Z= [((Zs)-(Zm)) -((Zs)-(Zm)) 0;

4 件のコメント

KSSV
KSSV 2022 年 1 月 10 日
Geenerally this error occurs when you join unequalled size arrays.
[rand(2,1), rand(3,1)]
Error using horzcat
Dimensions of arrays being concatenated are not consistent.
But it seems your code is fine:
arian hoseini
arian hoseini 2022 年 1 月 10 日
編集済み: arian hoseini 2022 年 1 月 10 日
im confused i dont know why but i've runned the program again and it worked...
DGM
DGM 2022 年 1 月 10 日
Just make sure to check the sizes of the variables being concatenated if you encounter similar errors in the future. It's easy to unintentionally expand something into an unexpected size, especially if you're used to older versions.
arian hoseini
arian hoseini 2022 年 1 月 10 日
thank u

サインインしてコメントする。

 採用された回答

DGM
DGM 2022 年 1 月 10 日
編集済み: DGM 2022 年 1 月 10 日

0 投票

It means that one or both of Zs or Zm are nonscalar. This works with scalars
Zs = 3;
Zm = 1;
Z= [(Zs-Zm) -(Zs-Zm) 0;
0 (Zs-Zm) -(Zs-Zm);
1 1 1 ]
Z = 3×3
2 -2 0 0 2 -2 1 1 1
If (Zs-Zm) were nonscalar, this concatenation wouldn't work.

1 件のコメント

KSSV
KSSV 2022 年 1 月 10 日
So OP has to clear the workspace and run...... j is already defined as vector, it is supposed to be a complex number.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeMatrices and Arrays についてさらに検索

製品

リリース

R2016b

タグ

質問済み:

2022 年 1 月 10 日

コメント済み:

2022 年 1 月 10 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by