clc;

k = input('Enter the value of gain,k:');

a = input('Enter the value of a,a:');

N = input('Enter the value of N:');

n = 0:1:N;

y = k*(a.^n);

subplot (3,1,1);

stem (n,y);

xlabel ('time');

ylabel ('amplitude');

title ('Exponential Sequence')

p = input('Enter the value of gain,p:');

a1 = input('Enter the value of real part,a1:');

b1 = input('Enter the value of imaginary part,b1:');

N1 = input('Enter the value of N1:');

n1 = 0:1:N1;

c = a1+b1*j;

x = p*(c.^n1);

subplot (3,1,2);

stem (n1,real(x));

xlabel ('time');

ylabel ('amplitude');

title ('Real Exponential Sequence')

subplot (3,1,3);

stem (n1,imag(x));

xlabel ('time');

ylabel ('amplitude');

title ('Complex Exponential Sequence')

disp ('Result is');

disp (x);

####

k = input('Enter the value of gain,k:');

a = input('Enter the value of a,a:');

N = input('Enter the value of N:');

n = 0:1:N;

y = k*(a.^n);

subplot (3,1,1);

stem (n,y);

xlabel ('time');

ylabel ('amplitude');

title ('Exponential Sequence')

p = input('Enter the value of gain,p:');

a1 = input('Enter the value of real part,a1:');

b1 = input('Enter the value of imaginary part,b1:');

N1 = input('Enter the value of N1:');

n1 = 0:1:N1;

c = a1+b1*j;

x = p*(c.^n1);

subplot (3,1,2);

stem (n1,real(x));

xlabel ('time');

ylabel ('amplitude');

title ('Real Exponential Sequence')

subplot (3,1,3);

stem (n1,imag(x));

xlabel ('time');

ylabel ('amplitude');

title ('Complex Exponential Sequence')

disp ('Result is');

disp (x);

####
**Output**

Enter the value of gain,k:4

Enter the value of a,a:5

Enter the value of N:7

Enter the value of gain,p:4

Enter the value of real part,a1:5

Enter the value of imaginary part,b1:3

Enter the value of N1:5

Result is

1.0e+004 *

0.0004 0.0020 + 0.0012i 0.0064 + 0.0120i -0.0040 + 0.0792i -0.2576 + 0.3840i -2.4400 + 1.1472i

Enter the value of a,a:5

Enter the value of N:7

Enter the value of gain,p:4

Enter the value of real part,a1:5

Enter the value of imaginary part,b1:3

Enter the value of N1:5

Result is

1.0e+004 *

0.0004 0.0020 + 0.0012i 0.0064 + 0.0120i -0.0040 + 0.0792i -0.2576 + 0.3840i -2.4400 + 1.1472i

## No comments:

## Post a Comment