matlab code error

• Nov 24th 2013, 09:26 AM
Vendetta
matlab code error
Matlab code
can you plz fix my error
code:

L=1;
T_inf=30;
qA=500;
c=5;
qB=c.*qA;
h=25;
dx=L/2;
dy=L/4;
kB=50;
syms T1 T2 T4 T5 T7 T8
for i=0:10:20
kA=i;
[sT1,sT2,sT4,sT5,sT7,sT8]=solve(T1*((h/dy)+(kA/dx^2)+(kA/dy^2))-T2*(kA/dx^2)-T4*(kA/dy^2)-(qA+h*T_inf)/dy,...
T2*((h/dy)+(kA/dx^2)+(kA/dy^2))-T1*(kA/dx^2)-T5*(kA/dy^2)-(qA+h*T_inf)/dy,...
T1*(-kA/dy^2)+T4*(((kA+kB)/dx^2)+(kA+kB)/dy^2)-T5*((kA+kB)/dx^2)-T7*(kB/dy^2),...
T2*(-kA/dy^2)-T4*((kA+kB)/dx^2)+T5*(((kA+kB)/dx^2)+(kA+kB)/dy^2)-T8*(kB/dy^2),...
T4*(-kB/dy^2)+T7*((h/dy)+(kB/dx^2)+(kB/dy^2))-T8*(kB/dx^2)-(qB+h*T_inf)/dy,...
T5*(-kB/dy^2)-T7*(kB/dx^2)+T8*((h/dy)+(kB/dx^2)+(kB/dy^2))-(qB+h*T_inf)/dy);
T_1(i)=sT1; T_2(i)=sT2; T_4(i)=sT4; T_5(i)=sT5; T_7(i)=sT7; T_8(i)=sT8;
end
• Nov 24th 2013, 01:25 PM
Rebesques
Re: matlab code error
The index i in T_1(i),T_2(i) etc must be a positive integer. So go to the for loop, and...
• Nov 25th 2013, 10:32 AM
Vendetta
Re: matlab code error
i changed the for loop ==> for i= 1:10:20 and the error goes
but still one problem in the line before the end showing me warning