Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

EXPERIMENT-1

AIM: To write a MATLAB program to generate an exponential sequence X(n)=(𝑎)𝑛 for i)


0 ≤ 𝑎 ≤ 1 ii) -1≤ 𝑎 ≤ 0 iii) a≤ 0 iv) a> 1

TOOLS: MATLAB v 2018a Software.


THEORY: The experiment comprises of plotting exponential functions X(n=)=(𝑎)𝑛 and
observing the behavior of the function when given various values. An exponential signal may
be

1.)Continuous : Which is given by X(t)= 𝑒 𝑎𝑡 where t is the independent variable of the


function and e is a constant. The value of the function completely depends upon the value of
t, For positive values X(t)exponentially increases while for negative values of t function
decreases exponentially

2.) Discrete: Function given by X(n)= (𝑎)𝑛 where a is dependent variable and the value of
the function completely dependent on the values of a and shows different behavior when a
takes different values between 0 ≤ 𝑎 ≤ 1,1 ≤ 𝑎 ≤ 0, a≤ 0, a> 1 the output generated after
running the source code will give the overview of the behavior for above values.

SOURCE CODE: The following coding is written on MATLAB to generate the


exponential sequence X(n)= (𝑎)𝑛 for the different values of inputs given to the above
function and then plotted using MATLAB
clear all
close all
clc
x=[1,2,3,4,5];
a1=input('range -10 to 10');
y=a1.^x;
subplot(2,2,1)
stem(y);
xlabel('inputs');
ylabel('outputs');
a1=input('range -10 to 10');
y=a1.^x;
subplot(2,2,2)
stem(y);
xlabel('inputs');
ylabel('outputs');
a1=input('range -10 to 10');
y=a1.^x;
subplot(2,2,3)
stem(y);
xlabel('inputs');
ylabel('outputs');

a1=input('range -10 to 10');


y=a1.^x;
subplot(2,2,4)
stem(y);
xlabel('inputs');
ylabel('outputs');
The above code runs to give the four plots of the function X(n) function is then plotted using
subplot function of the MATLAB which generates the plots for different input in all four
quadrants.

RESULT: Following are the results obtained shown as four different plot in Fig-1 for the
input applied.

INPUTS:
Enter any value b/w 0 to 1=0.9
Enter any value b/w -1 to 0=-0.9
Enter any value lesser than or equal to -1=-1.2
Enter any value greater than 1=1.2
OBSERVATION:
1.)When the input is applied to the function i.e the value of a between 0 and 1 function needs
to behave in exponentially decaying manner.
2.)When the input applied to the function that is the value of a between -1 and 0 function
needs to behave in exponentially decaying in alternative positive and negative manner.
3.)When the input applied to the function that is the value of a is lesser than or equal to -1
function needs to behave in exponentially increasing in alternate manner.
4.)When the input applied to the function that is the value of a is greater than 1 function
needs to behave in exponentially increasing throughout.

CONCLUSION: The experiment done on MATLAB to plot the behavior of the


exponential function X(n)= (𝑎)𝑛 for the different values of a gives the desired results by
generating various signal plots which clearly shows the behavior of the signal.

You might also like