Plotting serial data with Matlab. Unlimited channel.


Updated 15 Jan 2018

From GitHub

View License on GitHub

Plotting serial data with Matlab. Unlimited channel.
Usage instruction:

Find out what Serial port your device is connected to. In Matlab, in Matlab 2017, use "seriallist" function, in older verison, use "instrfind".
Change the serial string in code to whatever the port happens to be. e.g. "COM32".
In the microcontroller's code, intitate handshake protocal. (example will be given in Arduino and PSOC). Note, different micro-controllers have different quirks, you have to work it out yourself. e.g. PSOC will ignore the first character of the string.
Give the channel names in you MC codes.
Find out what integer length your MC use, change it in the Matlab code accordingly. The variable name is size_int _. It's in bytes. It's pretty obvious, you can't miss it.
Code the MC to transmit in Little-endian.
Initial the MC before running the Matlab code. Use a dead loop to halt the MC before it start.
Start the Matlab code, and you can see beautiful graphs updating infront of your eyes.
After you terminate the matlab code, remember to run the necessary clean up section of code to save the data to the file in .dat file, which named after the channel name.
Resource requirement: I tested the software with i5 7600k and no graphics card. When plotting 3 channel at display data size of 1000, it use approximately 3% of the cpu, 700Mb of RAM.

Cite As

Chen Duona (2023). vanGoghDaVinci/Matlab-plotter (, GitHub. Retrieved .

MATLAB Release Compatibility
Created with R2016a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Find more on Language Fundamentals in Help Center and MATLAB Answers

Community Treasure Hunt

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

Start Hunting!

Versions that use the GitHub default branch cannot be downloaded

Version Published Release Notes

To view or report issues in this GitHub add-on, visit the GitHub Repository.
To view or report issues in this GitHub add-on, visit the GitHub Repository.