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:
plot! please help..

Subject: plot! please help..

From: Iris

Date: 6 Dec, 2012 20:54:09

Message: 1 of 1

Hello everyone!
I have a matrix with the coordinates of objects (x,y,z) changing with time.
I need to plot 2 times the set of values, one being a scatter3 and another the trajectory, and so, see the moving object i need to plot a new scatter3 each time, and delete the previous, but to remain with the line, so the trajectory can be clear.

My code:

a = 0;
while t < T

a = a +1;
scatter3(Xx(:), Yy(:), Zz(:), Ar(:), 'k', 'EraseMode','xor');
plot3(X1, Y1, Z1, ':k', X2, Y2, Z2, ':k', X3, Y3, Z3, ':k');
    view(3)
    grid on
    xlabel('x')
    ylabel('y')
    zlabel('z')
    xlim([-40 40]);
    ylim([-40 40]);
    zlim([-40 40]);
    
    Mov(a) = getframe(gcf);

end
     
I'm trying to hold on just the plot3, but every time i try to do it the scatter3 hold's on too...

Thank u *

Tags for this Thread

No tags are associated with 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