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

1 visualización (últimos 30 días)
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))

Respuestas (1)

KALYAN ACHARJYA
KALYAN ACHARJYA el 21 de Nov. de 2020
Editada: KALYAN ACHARJYA el 22 de Nov. de 2020
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 comentarios
Image Analyst
Image Analyst el 21 de Nov. de 2020
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 el 22 de Nov. de 2020
@Image Analyst, Sorry sir, I missed the title of the question. Thank you for your detailed comment.

Iniciar sesión para comentar.

Categorías

Más información sobre Matrix Indexing en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by