% ============================================================================
% PlotTelemetry.m
% Author: Brent Dingle, Ph.D.
% Creation Date: 2020
%
% Grid 3 rows, 2 columns 
%    1 | 2
%   ---+---
%    3 | 4
%   ---+---
%    5 | 6
% ============================================================================
function tel = PlotTelemetry(telem)
  % Height graph
  subplot(3, 2, 1)
  plot(telem.t, telem.h, 'b') 
  title ('Height')
  xlabel('t')
  ylabel('h')
  grid

  % Velocity graph
  subplot(3, 2, 2)      
  plot(telem.t, telem.v, 'r')
  title ('Velocity')
  xlabel('t')
  ylabel('v')
  grid

  % Accel graph
  subplot(3, 2, 3)      
  plot(telem.t, telem.a, 'r')
  title ('Acceleration')
  xlabel('t')
  ylabel('a')
  grid

  % Thrust graph
  subplot(3, 2, 4)      
  plot(telem.t, telem.thrust, 'r')
  title ('Thrust')
  xlabel('t')
  ylabel('thrust')
  grid
  
  % Fuel graph
  subplot(3, 2, 5)      
  plot(telem.t, telem.fuel, 'g')
  title ('Fuel')
  xlabel('t')
  ylabel('fuel mass')
  grid
  
endfunction