Error using .* Matrix dimensions must agree. Error in eff_vs_length (line 20) Ty1=1-exp(​(-U.*AsurY​)./(m.*C)) >>

1 回表示 (過去 30 日間)
muhammad nur
muhammad nur 2020 年 11 月 21 日
編集済み: KALYAN ACHARJYA 2020 年 11 月 22 日
L=9.512;
Y=0:9.512;
m=0.11;
C=1007;
D=0.18;
AsurL=pi*D*L;
AsurY=pi*D*Y;
r1=0.043;
r2=0.045;
r3=0.090;
Rc=1./(AsurL*h);
Rp=(ln((r2)/(r1))./(2*pi*L*Kp));
Rg=(ln((r3)/(r2))./(2*pi*L*Kg));
Rt=Rc+Rp+Rg;
U=1./Rt;
Tg=30;
Tair=25;
Ty1=1-exp((-U.*AsurY)./(m.*C))

回答 (1 件)

KALYAN ACHARJYA
KALYAN ACHARJYA 2020 年 11 月 21 日
編集済み: KALYAN ACHARJYA 2020 年 11 月 22 日
Please define h,Kp and Kg
h=...?
Kp=..?
Kg=....? % Assumning all are scalar
%
L=9.512;
Y=0:9.512;
m=0.11;
C=1007;
D=0.18;
AsurL=pi*D*L;
AsurY=pi*D*Y;
r1=0.043;
r2=0.045;
r3=0.090;
Rc=1./(AsurL*h);
Rp=(log((r2)/(r1))/(2*pi*L*Kp));
Rg=(log((r3)/(r2))/(2*pi*L*Kg));
Rt=Rc+Rp+Rg;
U=1/Rt;
Tg=30;
Tair=25;
Ty1=1-exp((-U*AsurY)/(m*C))
  3 件のコメント
Image Analyst
Image Analyst 2020 年 11 月 21 日
Why didn't you answer his question? Anyway, this runs without error for me:
h=1
Kp=1
Kg=1
L=9.512;
Y=0:9.512;
m=0.11;
C=1007;
D=0.18;
AsurL=pi*D*L;
AsurY=pi*D*Y;
r1=0.043;
r2=0.045;
r3=0.090;
Rc=1./(AsurL*h);
Rp=(log((r2)/(r1))./(2*pi*L*Kp));
Rg=(log((r3)/(r2))./(2*pi*L*Kg));
Rt=Rc+Rp+Rg;
U=1./Rt;
Tg=30;
Tair=25;
Ty1=1-exp((-U.*AsurY)./(m.*C))
Besides, there are no matrices or vectors even IN your code so the error you gave could not possibly occur with that code. Everything inside parentheses is a constant and that constant is not being used as an index to any array. log() and exp() are functions, unless you defined then elsewhere (in another m-file or on the command line) to be arrays and overwrote the original functions that they are.
KALYAN ACHARJYA
KALYAN ACHARJYA 2020 年 11 月 22 日
@Image Analyst, Sorry sir, I missed the title of the question. Thank you for your detailed comment.

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

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by