{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Matlab_Graphics

# Matlab_Graphics - drawnow%i=i 1 end[x y = meshgrid-8 0.5 8...

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

%%%%%%%%%% 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])

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

View Full Document
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

{[ snackBarMessage ]}

### Page1 / 2

Matlab_Graphics - drawnow%i=i 1 end[x y = meshgrid-8 0.5 8...

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

View Full Document
Ask a homework question - tutors are online