How can I fix the rltool and bode functions "too many input arguments" error?

5 vues (au cours des 30 derniers jours)
Kristyn Wooldridge
Kristyn Wooldridge le 18 Nov 2017
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.'

Réponses (2)

Star Strider
Star Strider le 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 commentaires
Kristyn Wooldridge
Kristyn Wooldridge le 18 Nov 2017
thank you for your help!

Connectez-vous pour commenter.


eman salah
eman salah le 9 Avr 2020
please somone assist what to do to resolve the same problem, i don't have any idea what to do.

Catégories

En savoir plus sur Get Started with Control System Toolbox dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by