Matlab_Graphics

Matlab_Graphics - drawnow %i=i+1; end...

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

View Full Document Right Arrow Icon
%%%%%%%%%% x = 0:0.2:12; y1 = bessel(1,x); y2 = bessel(2,x); y3 = bessel(3,x); figure(1) subplot(2,2,1) h = plot(x,y1,x,y2,x,y3); set(h,'LineWidth',2,{'LineStyle'},{'--';':';'-.'}) set(h,{'Color'},{'r';'g';'b'}) axis([0 12 -0.5 1]) grid on xlabel('Time') ylabel('Amplitude') legend(h,'First','Second','Third') title('Bessel Functions') [y,ix] = min(y1); text(x(ix),y,'First Min \rightarrow',. .. 'HorizontalAlignment','right') %%%%%%%%%%%%%%%%%%%%%%%%%% % See Fig 12_3 in the text. % Also, see Fig12_3b.m for the prodution of % aversion that can be printed! % A = [ -8/3 0 0; 0 -10 10; 0 28 -1 ]; y = [35 -10 -7]'; h = 0.01; p = plot3(y(1),y(2),y(3), 'o', 'markersize', 2, . .. 'EraseMode','none'); % Set EraseMode to none axis([0 50 -25 25 -25 25]) hold on for i=1:2000 A(1,3) = y(2); A(3,1) = -y(2); ydot = A*y; y = y + h*ydot; % Change coordinates set(p,'XData',y(1),'YData',y(2),'ZData',y(3)) set(p,'color', [0 0 0])
Background image of page 1

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

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

Unformatted text preview: drawnow %i=i+1; end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% [x y ] = meshgrid(-8 : 0.5 : 8); r = sqrt(x.^2 + y.^2) + eps; z = sin(r) ./ r; surf(x,y,z,'facecolor','interp','edgecolor','none', . .. 'facelighting','phong') colormap jet daspect([5 5 1]) axis tight view(-50, 30) camlight left %%%%%%%%%%%%%%%%%%%%%%%%%%% randmap(:,1) = rand(64,1); randmap(:,2) = rand(64,1); randmap(:,3) = rand(64,1); image(1:64);colormap(randmap) %%%%%%%%%%%%%%%%%%%%%%%%%%%%% for k=1:16 plot(fft(eye(k+16))) axis equal M(k)=getframe; end movie(M,10) %%%%%%%%%%%%%%%%%% % animated sine graph x = 0; y = 0; dx = pi/40; p = plot(x, y, 'o', 'EraseMode', 'none'); % 'xor' shows only current point % ' none' shows all points axis([0 20*pi -2 2]) for x = dx:dx:20*pi; x = x + dx; y = sin(x); set(p, 'XData', x, 'YData', y) %drawnow pause(0.05) end...
View Full Document

This note was uploaded on 11/06/2011 for the course HANDOUT 502 at USC.

Page1 / 2

Matlab_Graphics - drawnow %i=i+1; end...

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