Got Questions? Get Answers.
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Plotting Captured Accelerometer Data into a 3D Line Graph

Subject: Plotting Captured Accelerometer Data into a 3D Line Graph

From: Darryl

Date: 13 May, 2013 22:01:07

Message: 1 of 4

I am trying to plot accelerometer data I captured from a comma separated file.

Firstly, I used the xlsxread function and read each column individually into variables:

x, y, z

I have already plotted this data within a 2D graph, but I am trying to display it into a more reader friendly format that displays each axis in a 3D line format that corresponds to each coordinate in space. I've tried lots of combinations within MatLab, but nothing seems to work so far.

I can attach a diagram of how I want it if I am not making things clear above.

Thanks.

Subject: Plotting Captured Accelerometer Data into a 3D Line Graph

From: Yehonatan Peleg

Date: 14 May, 2013 01:34:09

Message: 2 of 4

Have you tried plot3........?????

Subject: Plotting Captured Accelerometer Data into a 3D Line Graph

From: Darryl

Date: 14 May, 2013 13:25:23

Message: 3 of 4

"Yehonatan Peleg" <math8yehonatan@gmail.com> wrote in message <kms4ah$oue$1@newscl01ah.mathworks.com>...
> Have you tried plot3........?????

Yes I tried that, but I can't distinguish what axis is what. I can't even select each axis to change the colours etc.

Subject: Plotting Captured Accelerometer Data into a 3D Line Graph

From: Steven_Lord

Date: 14 May, 2013 13:41:37

Message: 4 of 4



"Darryl " <dazgti@hotmail.com> wrote in message
news:kmte02$fum$1@newscl01ah.mathworks.com...
> "Yehonatan Peleg" <math8yehonatan@gmail.com> wrote in message
> <kms4ah$oue$1@newscl01ah.mathworks.com>...
>> Have you tried plot3........?????
>
> Yes I tried that, but I can't distinguish what axis is what.

Label them with XLABEL, YLABEL, ZLABEL.

http://www.mathworks.com/help/matlab/ref/xlabel.html

> I can't even select each axis to change the colours etc.

Use SET to change the XColor, YColor, and ZColor properties of the axes.

surf(peaks)
set(gca, 'XColor', 'r', 'YColor', [0 0.5 0.5], 'ZColor', 'y')

The X axis will be red, the Y axis will be blue-green, and the Z axis will
be yellow.

--
Steve Lord
slord@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us