4.25

4.2 | 5 ratings Rate this file 100 Downloads (last 30 days) File Size: 1.24 KB File ID: #31857
image thumbnail

Real-Time Auto-Scrolling Graph from Serial Port

by

 

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

| Watch this File

File Information
Description

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.

MATLAB release MATLAB 7.12 (R2011a)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (6)
15 Oct 2013 Sumit Pokhrel

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 ?

21 Nov 2012 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?

21 Nov 2012 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?

13 May 2012 Lip

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

15 Feb 2012 Suresh  
15 Feb 2012 Suresh

Thanks a lot. I appreciate your effort.

Contact us