gga = '$GPGGA';
numMessages = 0;
s = serial('COM3');
fopen(s);
s.Timeout = 5;
while(numMessages < 10)
    inString = fscanf(s);
    if( strncmp(inString, '$GPGGA', 6) )
        inString
        numMessages = numMessages + 1;
    end
    pause(1);
end

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