error using plot data must be numeric, datetime, duration or an array convertible to double

조회 수: 2 (최근 30일)
WHY IT GIVE ME AN ERROR???
t=[0:0.1:50]
syms s
gs=1/(s^2 + 5*s + 6);
roots([1 5 6])
gjw=fourier(gs)
plot(t,gjw)

채택된 답변

Steven Lord
Steven Lord 2022년 2월 10일
Let's see what you're trying to plot.
t=[0:0.1:50]
t = 1×501
0 0.1000 0.2000 0.3000 0.4000 0.5000 0.6000 0.7000 0.8000 0.9000 1.0000 1.1000 1.2000 1.3000 1.4000 1.5000 1.6000 1.7000 1.8000 1.9000 2.0000 2.1000 2.2000 2.3000 2.4000 2.5000 2.6000 2.7000 2.8000 2.9000
syms s
gs=1/(s^2 + 5*s + 6);
roots([1 5 6]);
gjw=fourier(gs)
gjw = 
If you want to evaluate gjw for w equal to each of the elements in t you can do this, and then you can plot the result.
syms w
gjw_at_t = subs(gjw, w, t);
plot(t, gjw_at_t)
Warning: Imaginary parts of complex X and/or Y arguments ignored.
You might want to plot the real and imaginary parts of gjw_at_t separately.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Formula Manipulation and Simplification에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by