File Exchange

image thumbnail

NMEA 0183 Sentence Reader

version (2.54 KB) by Adam Leadbetter
Reads a NMEA 0183 sentence into a Matlab structure.


Updated 15 Mar 2010

View Version History

View License

Reads a NMEA 0183 (National Marine Electronics Association) sentence (or string) into a Matlab structure.

Cite As

Adam Leadbetter (2021). NMEA 0183 Sentence Reader (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (6)

Charlie Hogg

Thanks, very helpful.

I was wondering if this has been superseded by now and what the best tool is to read NMEA data. Particularly, I have about 1 GB of NMEA strings to read, so I need something quite fast.

I also had some crashes with this script when the NMEA strings weren't detected. The oderfields command crashed when given a Nan. I added this to the end of the code, which seemed to fix the problem for me.

if exist('data.ierr')%,'class')%~=-2
data = orderfields(data);


Hi, is it possible to get this .m file to read an text file containing gga,gst,vtg,zda ?

Kevin J. Delaney

Nicely done! Just what I needed.

Adam Leadbetter

Hi Febri,

Sorry for a slow reply

As per the help file:

The input is a Matlab string, as output by an NMEA instrument.
Currently I have implemented $GPGGA, $GPVTG, $GPZDA and $SDDBS stings.

You will get back a structure with different values (as described in the help file), and can return an error code for code diagnostics.

Any more questions, fell free to ask,


Febri Iswanto

Hi Adam,

I want to use your code to read NMEA sentence into matlab structure.
Could you explain how to use it, especially the input & the output data format?

Thanks before.



That's "NMEA 0183", not "NMEA 1803"

MATLAB Release Compatibility
Created with R2006b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!