Error using plot ; spectrum of function

조회 수: 1 (최근 30일)
geometry geometry
geometry geometry 2017년 11월 1일
댓글: geometry geometry 2017년 11월 2일
Why I get error using the following code?
syms t w;
syms g h;
g=fourier(exp(-1*(t^2)));
h=abs(g);
w=-10.1:10.1;
plot(w,h);

채택된 답변

Walter Roberson
Walter Roberson 2017년 11월 1일
plot(w, subs(h))
  댓글 수: 3
Walter Roberson
Walter Roberson 2017년 11월 1일
Worked fine when I tried on the code you posted.
If you have other code for calculating spectra then you should probably post that so we do not have to guess about what might not be working.
geometry geometry
geometry geometry 2017년 11월 2일
Yes thanks! I'm sorry it works fine. (I was using fplot instead of plot).

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Karan Gill
Karan Gill 2017년 11월 1일
Plot symbolic functions by using fplot.
fplot(h)
  댓글 수: 1
geometry geometry
geometry geometry 2017년 11월 1일
Thanks but it doesn't plot spectrum of f(t) correctly. I want to plot the spectrum of arbitrary function for example exp(-t^2) , dirac(t), ...
could you help me?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Line Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by