Newer
Older
leprob001
committed
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');
leprob001
committed
for i = 1:length(fnames)
if any(strcmp(fnames{i}, {'latitude', 'longitude', 'date'}))
continue;
end
leprob001
committed
current = pTrajectory.timeDivergenceToGps.(fnames{i});
if isempty(current)
continue;
end
leprob001
committed
x = current(:, 1);
y = current(:, 2);
handleTimeDivergenceToGps.(fnames{i}) = plot(pAxesHandle, x, y, '.-');
legendText{counter} = fnames{i};
counter = counter + 1;
leprob001
committed
end
hold(pAxesHandle, 'off');
%% Setup legend
handleLegend = legend(pAxesHandle, legendText, 'Location', 'best');