To generate discrete time sequences

5 views (last 30 days)
%unit impule
%unit step
%ranp
%exponential
%sine and cosine
t=(-1:0.1:1);
a=(-10:0.1:10);
r=(-1:0.1:1);
impule = t==0;
subplot(4,4,1:2);
stem(t,impule);
title('Unit Impulse');
step = t>=0;
subplot(4,4,3:4);
stem(t,step);
title('unit step');
ramp = r;
subplot(4,4,5:6);
stem(r,ramp);
title('ramp');
expn = exp(t);
subplot(4,4,7:8);
stem(t,expn);
title('exponential');
x=sin(a);
subplot(4,4,9:12);
stem(a,x);
title('Sine Wave');
y=cos(a);
subplot(4,4,13:16);
stem(a,y);
title('cosine wave');

Accepted Answer

Aniket Jadhav
Aniket Jadhav on 28 Nov 2022
%unit impule
%unit step
%ranp
%exponential
%sine and cosine
t=(-1:0.1:1);
a=(-10:0.1:10);
r=(-1:0.1:1);
impule = t==0;
subplot(4,4,1:2);
stem(t,impule);
title('Unit Impulse');
step = t>=0;
subplot(4,4,3:4);
stem(t,step);
title('unit step');
ramp = r;
subplot(4,4,5:6);
stem(r,ramp);
title('ramp');
expn = exp(t);
subplot(4,4,7:8);
stem(t,expn);
title('exponential');
x=sin(a);
subplot(4,4,9:12);
stem(a,x);
title('Sine Wave');
y=cos(a);
subplot(4,4,13:16);
stem(a,y);
title('cosine wave');

More Answers (0)

Categories

Find more on Operators and Elementary Operations in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!