Skip to content
Snippets Groups Projects
plotTimeDivergenceToGps.m 973 B
Newer Older
function [handleTimeDivergenceToGps, handleLegend] = plotTimeDivergenceToGps(pAxesHandle, pTrajectory)
%PLOTTIMEDIVERGENCETOGPS Summary of this function goes here
%   Detailed explanation goes here

%% Setup return variables
handleTimeDivergenceToGps = struct();

%% Get required data
fnames = fieldnames(pTrajectory.timeDivergenceToGps);
legendText = {};

%% Clear axes
cla(pAxesHandle);

%% Plot data
hold(pAxesHandle, 'on');
    if any(strcmp(fnames{i}, {'latitude', 'longitude', 'date'}))
        continue;
    end
    current =  pTrajectory.timeDivergenceToGps.(fnames{i});
    if isempty(current)
        continue;
    end
    x = current(:, 1);
    y = current(:, 2);
    handleTimeDivergenceToGps.(fnames{i}) = plot(pAxesHandle, x, y, '.-');
    legendText{counter} = fnames{i};
    counter = counter + 1;
handleLegend = legend(pAxesHandle, legendText, 'Location', 'best');