how to plot euler formula in matlab?
조회 수: 35 (최근 30일)
이전 댓글 표시
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
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/272363/image.png)
댓글 수: 1
Turlough Hughes
2020년 2월 18일
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
plot(y,'or')
채택된 답변
Star Strider
2020년 2월 18일
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)
figure
plot(y,'p')
plots a star at (1,0).
댓글 수: 4
Star Strider
2020년 2월 19일
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
.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/272546/image.png)
To see it:
figure
plot(t, real(y), t, imag(y))
grid
The two ‘y’ vectors are the same, so this works for either one of them.
참고 항목
카테고리
Help Center 및 File Exchange에서 Spectral Measurements에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!