GENERATION OF EXPONENTIAL FUNCTION

clc;
close all;
clear all;
n1=input('Enter Sequence Length:');
n=-2:n1-2;
y=10*exp(n);
subplot(2,1,1);
stem(n,y,'fill');
xlabel('n');
ylabel('y(n)');
grid on;
z=5*exp(-n);
subplot(2,1,2);
stem(n,z,'fill');
xlabel('n');
ylabel('z(n)');
grid on;
title('Exponential Sequence');

Input:

Enter Sequence Length:10

Output:

n1 =

10

No comments:

Post a Comment