0
$\begingroup$

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?

$\endgroup$
1
$\begingroup$

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.

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.