animationExamples - % Simple Plotting x = [5 10 15]; y =...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
%% Simple Plotting x = [5 10 15]; y = [20 21 22]; plot(x,y) % plot(time,acceleration) % axis([minOfX maxOfX minOfY maxOfY]) axis([min(x)-1 max(x)+1 min(y)-1 max(y)+1]) %% Example from LEC06 - no trail x = 0:0.1:10; y = 5*x.^2 - 3*x; for k=1:length(x) plot(x(k),y(k),'X') axis([min(x) max(x) min(y) max(y)]) pause(0.1); end %% Example from LEC06 - trail only x = 0:0.1:10; y = 5*x.^2 - 3*x; for k=1:length(x) plot(x(1:k),y(1:k),'X') axis([min(x) max(x) min(y) max(y)]) pause(0.01); end %% Example from LEC06 - no trail % X floating through space for t=0:0.1:20 % choose a small interval x=t*cos(t); y=5*sin(t); pause(0.05) % can come anywhere in the loop plot(x,y,'X') axis([-20 20 -5 5]) % must follow plot end %% Example from LEC06 - no trail % X floating through space t = 0:0.1:20; x=t.*cos(t); % don?t forget dot operations y=5*sin(t); for k = 1:length(x) pause(0.05) % can come anywhere in the loop plot(x(k),y(k),'X') axis([min(x) max(x) min(y) max(y)]) end %% Example from LEC06 - point and trail % X floating through space, leaving a trail t = 0:0.1:20; x=t.*cos(t); % don?t forget dot operations
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 4

animationExamples - % Simple Plotting x = [5 10 15]; y =...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online