How can I fix the rltool and bode functions "too many input arguments" error?
5 次查看(过去 30 天)
显示 更早的评论
When I try to run the rltool or bode function, I get the error with "too many input arguments". Here is an example of running the code: >> s = tf('s')
s =
s
Continuous-time transfer function.
>> G = (s+2)/(s^2+s+4)
G =
s + 2
-----------
s^2 + s + 4
Continuous-time transfer function.
>> bode(G) Error using DynamicSystem/bode (line 95) Too many input arguments.
The same happens with rltool(G): >> rltool(G) Error using rltool (line 89) Too many input arguments.
I have tried uninstalling MATLAB 2017b and re-installing, and it has not solved the problem. I have also tried this on 2016a and 2017a. I have also passed with no input arguments to the bode function and get:
>> bode Here is an example of how the function bode works: Consider a randomly generated stable Transfer Function Model: of the form G(s)=num(s)/den(s): num = 0 -0.1022 0.0316 0.1934 -0.1795 0.1620 den = 1.0000 6.2190 50.6538 222.7866 359.5180 162.7478 Call bode using the following command (see also, help bode): bode(tf(num,den)); ans = 'Error using DynamicSystem/bode (line 95) Too many input arguments.'
0 个评论
回答(2 个)
Star Strider
2017-11-18
Your code runs for me without error.
You probably have a variable named ‘bode’ in your workspace. Run this from your Command Window or a script:
which bode -all
If the first result is:
bode is a variable.
you have found the problem. (This is called ‘overshadowing’ of a function and is to ba avoided.)
The solution is to rename the variable to something that doesn’t share the same name as a function.
4 个评论
eman salah
2020-4-9
please somone assist what to do to resolve the same problem, i don't have any idea what to do.
0 个评论
另请参阅
类别
在 Help Center 和 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!