MATLAB Answers

how to plot euler formula in matlab?

114 views (last 30 days)
ABTJ on 18 Feb 2020
Commented: Star Strider on 19 Feb 2020
I want to plot exponential signal that is euler formula exp(i*pi) in MATLAB but output figure is empty and does not shows graph as shown in attached, even i tried plotting simpler version, i mean
exp(i*pi),but still figure was empty

  1 Comment

Turlough Hughes
Turlough Hughes on 18 Feb 2020
There is an example of plotting exponentials in the documentation here, see the sub heading Plot Exponential Function. If you're trying to observe a single point on the plot you could also write

Sign in to comment.

Accepted Answer

Star Strider
Star Strider on 18 Feb 2020
The plot function plots lines between points. You have only one point, so if you change the plot call to:
y = exp(100*i*pi)
plots a star at (1,0).


Show 1 older comment
Star Strider
Star Strider on 18 Feb 2020
If you mean the Euler identity :
y = exp(100*i*pi)
y = cos(100*pi)+j*sin(100*pi)
with both producing:
y =
1.0000e+000 + 1.9644e-015i
y =
1.0000e+000 + 1.9644e-015i
That is the best I can do with the information I have.
ABTJ on 19 Feb 2020
But still in this case we are getting only one point at (1,0). How we can see ful wave/plot of euler identity for atlest one period??
Star Strider
Star Strider on 19 Feb 2020
Add a time-varying vector:
t = linspace(0,2);
y = exp(100*i*pi*t)
y = cos(100*pi*t)+j*sin(100*pi*t);
and now the results will go from 0 to .
To see it:
plot(t, real(y), t, imag(y))
The two ‘y’ vectors are the same, so this works for either one of them.

Sign in to comment.

More Answers (1)

KSSV on 18 Feb 2020
Edited: KSSV on 18 Feb 2020
i = linspace(0,1,100) ;
y = exp(100*i*pi) ;


Sign in to comment.




Translated by