% Lecture GPS

function [lat,long,date,time] = lecture_gps(obj1);
% We only want the strings with $GPGLL…   

data=''; 
while isempty(strmatch('$GPGLL',data)) 
data = fscanf(obj1); 
end

% Parse the string to obtain coordinates 
[lat,data] = strtok(data,','); 
[lat,data] = strtok(data,','); 
[nsCardinal,data] = strtok(data,','); 
[long,data] = strtok(data,','); 
[ewCardinal,data] = strtok(data,','); 
lat = str2double(lat); 
long = str2double(long);

% Date and Time to do
date = 'xx';
time = 'yy';


% Display the results
disp({lat,nsCardinal,long,ewCardinal});

