# plotting exp signal in matlab

My program is as follows:

n = 0:1:127;
s1=exp(2*pi*1i*(0.05*n+0.1*n.^2/(2*128)+0.2*n.^3/(128*128*3)));
s2=exp(2*pi*1i*(0.1*n+0.1*n.^2/(2*128)+0.2*n.^3/(128*128*3)));
s3=exp(2*pi*1i*(0.4*n+0.1*n.^2/(2*128)-0.5*n.^3/(128*128*3)));
s4=exp(2*pi*1i*(0.45*n+0.1*n.^2/(2*128)-0.1*n.^3/(128*128*3)));
s = [(s1.') (s2.') (s3.') (s4.')];


I wanted to plot the signal in MATLAB. I am getting a circular plot in which data is not proper. What are the steps for obtaining a clear data?

## 1 Answer

A snippet from the MATLAB documentation of the plot command:

plot(Y) creates a 2-D line plot of the data in Y versus the index of each value...If Y is complex, then the plot function plots the imaginary part of Y versus the real part of Y, such that plot(Y) is equivalent to plot(real(Y), imag(Y)).

The circular plot you're seeing is corresponding to the real part on the x-axis and the imaginary part of the y-axis.

If you're doing plot(s), then MATLAB is plotting each column in s.

• thank you for your answer – Pranav kumar E.A May 6 '20 at 23:07