Streaming Serial Plotter
Updated 30 Jul 2016
I use micro-controllers in a lot of my projects and end up doing a lot of data analysis and testing in MATLAB. Have always been frustrated at existing ways to connect the two - saving data to SD card is slow, copy/pasting from a serial port monitor is frustrating, naming .csv files is annoying and easy to forget, excel is slow. I wanted a tool that can simply
1) easily connect to a generic USB serial stream
2) parse the stream regardless of number of data channels being reported
3) quickly plot the data for quick inspection and
4) saves the data to the MATLAB workspace for post-recording analysis.
streaming_plotter.m fulfills those goals. Finds active serial ports. Works at speeds up to several hundred Hz (depending on number of data channels), plots in real time. This code requires the Instrumentation toolbox. Tested with Teensy 3.2, Teensy LC, and Arduino UNO.
To operate, download the .zip folder and extract. If you haven't used a MATLAB GUI before, please note that to run it you should keep the .m and .fig files in the same folder. Simply run the .m file as you would any other script and the GUI will appear. type >>help streaming_plotter in the command line to get instructions and an example in 'arduino-flavored' C for testing the code.
Austin Gurley (2023). Streaming Serial Plotter (https://www.mathworks.com/matlabcentral/fileexchange/58452-streaming-serial-plotter), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform CompatibilityWindows macOS Linux
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.