gga = '$GPGGA';
numMessages = 0;
s = serial('COM1',...
'BaudRate',9600, ...
    'Parity','none', ...
    'StopBits',1, ...
    'ReadAsyncMode','manual',...
    'Terminator','CR/LF', ...
    'InputBufferSize',8192);

fopen(s);
s.Timeout = 5;

plot3(0, 0, 0, '+');
hold

for i=1:5
    fprintf(s, 'pos v7,4');
    fscanf(s,'%sZ%d', inStr, depth)
    pause(2)
end

% while( numMessages < 2)
%     inString = fscanf(s);
%     if( strncmp(inString, '$GPGGA', 6) )
%         [token,remain] = strtok(inString,',');
%         [token,remain] = strtok(remain,',');
%         [token,remain] = strtok(remain,',');
%         vals = sscanf(token, '%2d%f');
%         dDeg = vals(1) + (vals(2)/60.0)
%         numMessages = numMessages + 1;
%     end
%     pause(1);
% end

fclose(s);
delete(s);
clear s;
