clear all; close all; t=[0:0.1:6]; ft=2/3.*t; ot=[]; for i=1:length(ft) if (t(i) < 3) ot=[ot 1]; else ot=[ot 0]; end end gt=ft.*ot; figure; subplot(3,1,1); plot(t,gt); w0=2*pi/6; syms n t; j=sqrt(-1); it=int(2/3*t*exp(-j*n*w0*t),0,3) n=[-10:10]; pt=subs(it, n); subplot(3,1,2); stem(n, abs(pt)); subplot(3,1,3); stem(n,angle(pt));