How can I fix the rltool and bode functions "too many input arguments" error?
Show older comments
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.'
Answers (2)
Star Strider
on 18 Nov 2017
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 Comments
Kristyn Wooldridge
on 18 Nov 2017
Star Strider
on 18 Nov 2017
Yes.
The usual cause of that error is an overshadowing variable. If bode still doesn’t work, I have no idea what the problem could be.
It’s now time to Contact Support (link). Copy the URL of this thread to your Question so MathWorks knows what your problem is and what we’ve attempted in order to fix it.
Kristyn Wooldridge
on 18 Nov 2017
Star Strider
on 19 Nov 2017
My pleasure.
eman salah
on 9 Apr 2020
0 votes
please somone assist what to do to resolve the same problem, i don't have any idea what to do.
Categories
Find more on Get Started with Control System Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!