Bode

조회 수: 18 (최근 30일)
Diego Aguilera
Diego Aguilera 2011년 7월 6일
댓글: Hamed Pouria 2019년 7월 6일
I am new to Matlab. I need to use the Bode command. When I run my code, I get this error: "Undefined function or method 'bode' for input arguments of type 'double'."
  댓글 수: 1
Ruben Ubeda
Ruben Ubeda 2015년 1월 29일
i have the same problem!

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

답변 (3개)

Oleg Komarov
Oleg Komarov 2011년 7월 6일
You may not have the Control System Toolbox. To check that type ver in the command window.

Paulo Silva
Paulo Silva 2011년 7월 6일
Besides Oleg suggestion, bode doesn't take double arguments, you must provide one transfer function instead.
%simple example from the bode function documentation
g = tf([1 0.1 7.5],[1 0.12 9 0 0]);
bode(g)
Here's a way to do the bode plot without the control toolbox:
sys=@(s) (s.^2+0.1*s+7.5)./(s.^4+0.12.*s.^3+9*s.^2)
w=1:0.01:40;
amp=10*log10(abs(sys(w*i)));
ang=angle(sys(w*i))*180/pi;
subplot(211)
plot(w,amp)
title(char(sys))
ylabel('Magnitude (DB)')
set(gca,'xscale','log')
subplot(212)
plot(w,ang)
set(gca,'xscale','log')
xlabel('frequency (rad/sec)')
ylabel('phase (deg)')
  댓글 수: 2
Seng Tak Goh
Seng Tak Goh 2019년 4월 18일
Hi Paulo,
That was amazing! Do you mind to explain how sys=@(s) actually does the trick?
Many thanks in advance!
Hamed Pouria
Hamed Pouria 2019년 7월 6일
It has some promlems.
in line 3 you must write :
amp=20*log10(abs(sys(w*i)));
and also if the number of poles - number of zeros of the system will be bigger than 2 (for example 3) it does not work correctly because of the strict of the function angle(); It will return the phase angles only within the interval [-pi to pi].

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


Diego Aguilera
Diego Aguilera 2011년 7월 6일
I'm guessing it's not installed...
-------------------------------------------------------------------------------------
MATLAB Version 7.11.0.584 (R2010b)
MATLAB License Number: ###########[SCd Censor]
Operating System: Mac OS X Version: 10.6.7 Build: 10J869
Java VM Version: Java 1.6.0_24-b07-334-10M3326 with Apple Inc. Java HotSpot(TM) 64-Bit Server VM mixed mode
-------------------------------------------------------------------------------------
MATLAB Version 7.11 (R2010b)
Simulink Version 7.6 (R2010b)
Curve Fitting Toolbox Version 3.0 (R2010b)
SimPowerSystems Version 5.3 (R2010b)
  댓글 수: 2
Oleg Komarov
Oleg Komarov 2011년 7월 6일
No guess here.
Diego Aguilera
Diego Aguilera 2011년 7월 6일
Ha. I'm upgrading to the newest version. I believe the it has the Control System Toolbox. I'll find out in a few hours. Thanks.

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

카테고리

Help CenterFile Exchange에서 Classical Control Design에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by