Updated 15 Jan 2018
Plotting serial data with Matlab. Unlimited channel.
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.
Chen Duona (2023). vanGoghDaVinci/Matlab-plotter (https://github.com/vanGoghDaVinci/Matlab-plotter), GitHub. 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.
Versions that use the GitHub default branch cannot be downloaded