Trouble using Bode(sys)
显示 更早的评论
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
2023-5-15
1 个投票
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 个评论
Eli Wolkenstein
2023-5-15
Eli Wolkenstein
2023-5-15
Star Strider
2023-5-15
At this point I suggest that you Contact Support . Include a link to this thread so they know what steps you’ve already taken, and the results.
It might be necessary to uninstall and reinstall MATLAB.
Meanwhile, use MATLAB Online to complete the assignment. That’s a temporary work-around until you can get it working on your computer again (although I use it extensively for prototyping Answers code, since it doesn’t have the 55 second limit that the online Run feature has, and it’s actually easier to use for that purpoose). You’ll have access to everything you’re licensed for.
Serigne MBENGUE
2025-9-4
hi. This solution works. Thanks
Star Strider
2025-9-4
Manoj Mirge
2023-5-15
0 个投票
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:
类别
在 帮助中心 和 File Exchange 中查找有关 Get Started with Control System Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


