- #1
eltrinco
- 8
- 0
i have created my animation :
function plot_pix(v,t)
%project 2d pictures
view = [1 0 0 ; 0 1 0]; % projection matrix for 2D pictures
dim = .8e13; %limit of figure
plot(v(:,1),v(:,2),'r.'); %plotting red masses
hold on;
%plot(v(1,1),v(1,2),'y*');-plottint green point
scatter(v(1,1),v(1,2),15,'filled','green'); %a star as the centre for all planets
axis([-dim dim -dim dim]); %limits of figure
axis square %set the figure axis to fit tightly around the data so that the planets which bounce more outwards still can be seen
title(['No. of Steps : ' num2str(t) ]); %title of figure
hold off
shg; % show the most recent figure in window
pause(.02);
end
i want to add the play and stop function in it. how do i do it?
function plot_pix(v,t)
%project 2d pictures
view = [1 0 0 ; 0 1 0]; % projection matrix for 2D pictures
dim = .8e13; %limit of figure
plot(v(:,1),v(:,2),'r.'); %plotting red masses
hold on;
%plot(v(1,1),v(1,2),'y*');-plottint green point
scatter(v(1,1),v(1,2),15,'filled','green'); %a star as the centre for all planets
axis([-dim dim -dim dim]); %limits of figure
axis square %set the figure axis to fit tightly around the data so that the planets which bounce more outwards still can be seen
title(['No. of Steps : ' num2str(t) ]); %title of figure
hold off
shg; % show the most recent figure in window
pause(.02);
end
i want to add the play and stop function in it. how do i do it?