image thumbnail


version (1.46 KB) by Val Schmidt
A function to calculate the checksum for a NMEA/GPS string.


Updated 03 May 2022

View License

Typical output from GPS receives comes in the form of ASCII strings conforming to the NMEA 0183 standard. An example string might look like this:
There are many types of strings, but each one starts with a $ and end with a * followed by a checksum of the characters between the $ and *.
Given a string of chacters containing a leading $ and a trailing *, gps_chksum calculates the checksum at the end, allowing one to create one's own valid string, or check the validity of any string received.
Version 2.0 Fixed to allow calculation on arbitrary strings that don't already have characters in the checksum field. The input string must have a leading $ and a trailing *. The checksum is calculated on the characters between the $ and *, per the NMEA standard.

Cite As

Val Schmidt (2022). gps_chksum (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2011b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags

Community Treasure Hunt

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

Start Hunting!