Hi all, I'm not very good at MATLab and can't tell what is wrong or what this means, any help would be greatly appreciated.
Here is the code:
%Analytical
clc;T = 200; %degrees C
D = 5E-3; %m
L = 50E-3; %mT0 = 25; %degrees Ch = 100; %W/m^2 K
k = 393; %W/m^2 k
Ac = (pi/4)*(5E-3)^2;P = pi*(5E-3);m = sqrt((h*P)/(k*Ac));Tx=zeros(5,1);L3=(0:.0015:.05);for n=1:length(L3) Tx(n,1)= (cosh(m*(L-L3(n,1)))*(h/(m*k))*sinh(m*(L-L3(n,1)))/(cos(m*L)+(h/(m*k))*sinh(m*L)))*(T-T0)+(T0)end
And here is the output
Tx = 28.9774 0 0 0 0Index in position 1 exceeds array bounds (must not exceed 1).Error in Analytical (line 16) Tx(n,1)= (cosh(m*(L-L3(n,1)))*(h/(m*k))*sinh(m*(L-L3(n,1)))/(cos(m*L)+(h/(m*k))*sinh(m*L)))*(T-T0)+(T0)
Best Answer