My plot doesnt exist
Show older comments
my function:
function result=climbjet(H)
T0=288.15; %Standard atmospheric temperature at MSL
p0=101325; %Standard atmospheric pressure at MSL
ro0=1.225; %Standard atmospheric density at MSL
a0=340.294; %Speed of sound
K=1.4; %Adiabatic index of air
R=287.05287; %Real gas constant for air
g0=9.80665; %Gravitational acceleration
beta=-0.0065; %ISA temperature gradient with altitude below the tropopause
vstall=142; %from aircraft.OPF
vcl1=172; %335 knots
vcl2=172; %335 knots
machcl=0.86;
cvmin=1.3;
vdcl1=5;
vdcl2=10;
vdcl3=30;
vdcl4=60;
vdcl5=80;
%Mach transition altitude=29000 ft
if (H<=1499)
result=(cvmin*vstall)+vdcl1;
elseif (H<2999)
result=(cvmin*vstall)+vdcl2;
elseif (H<3999)
result=(cvmin*vstall)+vdcl3;
elseif (H<4999)
result=(cvmin*vstall)+vdcl4;
elseif (H<5999)
result=(cvmin*vstall)+vdcl5;
elseif (H<9999)
result=min([vcl1,129]);
elseif (H<28999)
result=vcl2;
elseif (H<=35000)
result=machcl*a0;
else
disp('error');
end
end
I am trying to plot with this code :
H=[0:100:35000];
plot(H,climbjet(H))
But plot does not appear. Please help
Answers (1)
result = zeros(size(H));
for i=1:numel(H)
if H(i)<=1499
result(i) = (cvmin*vstall)+vdcl1;
elseif H(i)>1499 && H(i)<2999
result(i)=(cvmin*vstall)+vdcl2;
...
end % if statements
end % for loop
Categories
Find more on Geodesy and Mapping in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!