Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Help with plot
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List  
Iris

Posts: 8
Registered: 11/27/12
Help with plot
Posted: Dec 6, 2012 11:01 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hello guys! :)
I have a matrix of values to plot, of dimensions (1:i_t,3*N). This represents, for N particles, the x, y and z coordinates, and as for the lines, is their position thought time, like this:

x1(t=0) y1(t=0) z1(t=0) x2(t=0) y2(t=0) z2(t=0) x3(t=0) y3(t=0) z3(t=0) .....
x1(t=1) y1(t=1) z1(t=1) x2(t=1) y2(t=1) z2(t=1) x3(t=1) y3(t=1) z3(t=1) .....
x1(t=2) y1(t=2) z1(t=2) x2(t=2) y2(t=2) z2(t=2) x3(t=2) y3(t=2) z3(t=2) .....
.......... ........... ........... ........... ........... ........... ........... ........... .......... .....

I have a routine to plot this that is:

for i = 1:N

X = Ra(:,(3*i-2));
Y = Ra(:,(3*i-1));
Z = Ra(:,3*i);
scatter3(Ra(1,(3*i-2)), Ra(1,(3*i-1)), Ra(1,(3*i)), 'k')
plot3(X, Y, Z, ':k')
scatter3(Ra(i_t,(3*i-2)), Ra(i_t,(3*i-1)), Ra(i_t,(3*i)), 'k')

view(3)
grid on
xlabel('x')
ylabel('y')
zlabel('z')

end

but the problem is that i need to do a movie of it, and this way it plots the values of the first particle for all times, then the values of the second particle for all times, and so on... what i need to do is, for the specific time, plot all the particles, can you help me with this please?!...
Thank you in advance :)




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.