close all clear all clc T = 0.01; t = 0:T:10; om0 = 2*pi; phi0 = pi/2; om1 = pi; phi1 = pi/3; x = cos(om0*t+phi0); y = sin(om1*t+phi1); z = x+y; figure(1) subplot(2,1,1) plot(t,x,'b-',t,y,'r-') grid legend('x(t)','y(t)') subplot(2,1,2) plot(t,z,'k-') grid legend('z(t)=x(t)+y(t)') om0 = 2*pi; phi0 = pi/2; om1 = 2; phi1 = pi/3; x = cos(om0*t+phi0); y = sin(om1*t+phi1); z = x+y; figure(2) subplot(2,1,1) plot(t,x,'b-',t,y,'r-') grid legend('x(t)','y(t)') subplot(2,1,2) plot(t,z,'k-') grid legend('z(t)=x(t)+y(t)')