%plot_flightpaths plots flightpaths by using the data calculated by
flightpath.m
%
Creates plots of altitude vs distance, altitude vs time,
%
horizontal velocity vs time, and vertical velocity vs time
%
To call the function: plot_flightpaths(t,u,v,x,y)
%
%
Input arguments: t, u, v, x, y
%
Where: t is time, u is horizontal velocity, v is vertical velocity, x
%
is position on the x-axis (range/distance), and y is altitude
%
%
Output arguments: yx, yt, ut, vt
%
Where: yx, yt, ut, vt are plots
%Creates the graph for y versus x
figure(1);
%Makes a new figure for the y vs x graph
yx = plot(x,y);
%Plots the graph of altitude vs distance
legend(
'k = 0'
,
'k = 0.005'
,
'k = 0.01'
,
'k = 0.02'
,
'k = 0.04'
,
'k =
0.08'
);
%Creates the legend
title(
'Altitude vs Distance'
)
%Titles the graph
xlabel(
'Distance (km)'
)
%x-axis label
ylabel(
'Altitude (km)'
)
%y-axis label
grid
on
%Makes grid lines appear
hold
on
%Retains plots from this loop and previous loops so that new plots do
not delete existing plots.
clc
%Clears the warning messages
%Creates the graph for y vs t
figure(2);
%Makes a new figure for the y vs t graph
yt = plot(t,y);
%Plots the graph of altitude vs time
legend(
'k = 0'
,
'k = 0.005'
,
'k = 0.01'
,
'k = 0.02'
,
'k = 0.04'
,
'k =
0.08'
);
%Creates the legend
title(
'Altitude vs Time'
)
%Titles the graph