On Friday, April 12, 2013 3:35:08 AM UTC+12, Daniel wrote:
> Hi
>
>
>
> I'm trying to plot a series of lines within a loop on another plot, so that only the current loops line shows up on the old plot, whilst holding the old plot as it is.
>
>
>
> for i=1:endpoint
>
> for j=1:endtime
>
> plot3([0 XL1(i,j)],[0 YL1(i,j)],[0 ZL1(i,j)],'LineWidth',2);
>
> plot3([XL1(i,j) XL1(i,j)+XL2(i,j)],[YL1(i,j) YL1(i,j)+YL2(i,j)],[ZL1(i,j) ZL1(i,j)+ZL2(i,j)],'LineWidth',2);
>
> pause(0.1)
>
> end
>
> end
>
>
>
> thats the plot i want added to the old figure, but if i add 'hold off', it removes the previous plot.
>
> How do i fix this?
I think what you want is:
help comet3
> Hi
>
>
>
> I'm trying to plot a series of lines within a loop on another plot, so that only the current loops line shows up on the old plot, whilst holding the old plot as it is.
>
>
>
> for i=1:endpoint
>
> for j=1:endtime
>
> plot3([0 XL1(i,j)],[0 YL1(i,j)],[0 ZL1(i,j)],'LineWidth',2);
>
> plot3([XL1(i,j) XL1(i,j)+XL2(i,j)],[YL1(i,j) YL1(i,j)+YL2(i,j)],[ZL1(i,j) ZL1(i,j)+ZL2(i,j)],'LineWidth',2);
>
> pause(0.1)
>
> end
>
> end
>
>
>
> thats the plot i want added to the old figure, but if i add 'hold off', it removes the previous plot.
>
> How do i fix this?
I think what you want is:
help comet3