% % code5Wa.m -- 02 oct 02 -- djm % % clear workspace & graphics ("help clear", etc) clear; close all % axes t = -2*pi:pi/30:4*pi; a = 3; b = -2; yC = a*cos(t); yS = b*sin(t); A = sqrt(a^2 + b^2); B = atan(b/a); yT = A*cos(t-B); % plot line graphs figure(1); hold on plot(t,yC,'b--') plot(t,yS,'b--') plot(t,yC+yS,'b','linewidth',3) plot(t,yT,'r') axis([-2*pi 4*pi -1.1*A 1.1*A]); % label plot ("\bf"-prefix makes text boldface) title(['\bf sinusoids']) xlabel('t-axis') ylabel('y-axis') %text(5,0.1,'y = x/(1+x^2)') %text(1,0.55,'local max at (1,0.5)')