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:
3-D Plot Help

Subject: 3-D Plot Help

From: Chris

Date: 23 Nov, 2010 21:29:05

Message: 1 of 2

Hello,

I have 3 vectors, with x y and z coordinates that I would like to plot. I would like to show these points plotted over a period of time though in a video. (plot point 1, wait a second, plot point 2 etc). This is to show the motion of a particle over time.

Any thoughts on how to do this?

Subject: 3-D Plot Help

From: Sean de

Date: 23 Nov, 2010 21:40:25

Message: 2 of 2

"Chris " <c_v31@hotmail.com> wrote in message <ichbn1$fl$1@fred.mathworks.com>...
> Hello,
>
> I have 3 vectors, with x y and z coordinates that I would like to plot. I would like to show these points plotted over a period of time though in a video. (plot point 1, wait a second, plot point 2 etc). This is to show the motion of a particle over time.
>
> Any thoughts on how to do this?

%%%%%
%Data
x = 1:10;
y = 1:10;
z = rand(1,10);

%Engine
figure;
hold on
for ii = 1:10
    plot3(x(ii),y(ii),z(ii),'r*','MarkerSize',14);
    pause(1)
end
%SCd
%%%%%

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