File Exchange

image thumbnail

Real-Time Auto-Scrolling Graph from Serial Port

version 1.0 (1.24 KB) by

It Plots a real-time running graph taking inputs from a serial port.

26 Downloads

Updated

View License

This script takes input from the Serial port 'COM4' with the baud rate of 19200 and plots a running graph with the X-axis range of 200.

I used it for my IMU sensor so the input is in the form of strings '<accX accY accZ>' (eg:- '381 328 420'), you can also add the gyro readings to it. I run the loop to 1000 iterations you can modify to suit your purpose. A better solution i will try later is to take the time inputs from your device(i used Arduino so i will possibly use micros()) to get exact time related outputs.

It is a bit slow due to the usage of 'drawnow' but i'll try it with other methods and post a better version soon.

I haven't commented it nicely cause i think the code is fairly self-explanatory.

Comments and Ratings (6)

Attempted to access sen(1);
index out of bounds because
numel(sen)=0.

Error in Plotter (line 13)
    accX(j)=sen(1);
 
DO you know how to fix this ?

Merlin Mifsud

Dear all,
I had some mistakes regarding previous comment.
 
I want to interface an adis16480 IMU sensor with matlab, however this is not possible using the ug-287 evaluation board.
Now I am wondering if it is possible to read spi ports using arduino and read the arduino data from matlab?
And how possible it is to write and read from Maltab to the Spi Ports of the ADIS16480?

Merlin Mifsud

Dear all,
I want to interface an adis16480 IMU sensor with matlab, however this is not possible using the ug-287 evaluation board.
Now I am wondering if it is possible to read serial ports using arduino and read the arduino data from matlab?
And how possible it is to write and read from Maltab to the Serial Ports of the ADIS16480?

Lip

Lip (view profile)

Thanks!
This is what I'm looking for. Simple yet effective.

Suresh

Suresh (view profile)

Suresh

Suresh (view profile)

Thanks a lot. I appreciate your effort.

MATLAB Release
MATLAB 7.12 (R2011a)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video