Trouble using Bode(sys)

조회 수: 6 (최근 30일)
Eli Wolkenstein
Eli Wolkenstein 2023년 5월 11일
댓글: Star Strider 2025년 9월 4일
I try using the bode function and i get an error that says "Error using DynamicSystem/bode
Dimensions of arrays being concatenated are not consistent." I have seen bode being used even what the arrays are not the same size. Anybody know what's wrong? (I just ran it in this question box and it worked now so why wont it work for me on my MATLAB? I have the control systems toolbox.
m = 2;
b = 5;
k = 600;
Ybar = 20;
sys = tf([k],[m b k]);
figure
hold on
bode(sys)
grid on

답변 (2개)

Star Strider
Star Strider 2023년 5월 15일
You could have a path problem.
Run these:
restoredefaultpath
rehash toolboxcache
from a script or your Command Window to see if that solves the problem.
  댓글 수: 5
Serigne MBENGUE
Serigne MBENGUE 2025년 9월 4일
hi. This solution works. Thanks
Star Strider
Star Strider 2025년 9월 4일
My pleasure!
A Vote would be appreciated!

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


Manoj Mirge
Manoj Mirge 2023년 5월 15일
It might be possible that you have your own custom “tf" or bode" function defined somewhere in your MATLAB path and at the time of calling those functions in your MATLAB script the script is calling the custom function instead of MATLAB’s built in bode and tf" functions.
To check if you have a local custom function shadowing the MATLAB’s built-in function you can use which" function. If you have a local function shadowing the built-in function, you can delete that function or remove that function from MATLAB path.
You can read more about how to use which function in the below link:
  댓글 수: 1
Eli Wolkenstein
Eli Wolkenstein 2023년 5월 15일
when I run the which function it returns this:
>> which tf
C:\Program Files\MATLAB\R2023a\toolbox\control\ctrlmodels\@tf\tf.m % tf constructor
>> which bode
C:\Program Files\MATLAB\R2023a\toolbox\control\ctrlobsolete\bode.m
which I believe are the correct functions for what I'm trying to use. It's not showing me any other "tf" or "bode" custom function I might hve made.

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

카테고리

Help CenterFile Exchange에서 Get Started with Control System Toolbox에 대해 자세히 알아보기

태그

제품


릴리스

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by