Too many Input Arguments error when using Transfer Functions and bodeplot()

This is my transfer function:
H1s =
1.25e04 s
----------------------
s^2 + 1.25e04 s + 1e10
Continuous-time transfer function.
(output from the MATLAB console)
When I try to do bodeplot(H1s) I get the error "Error using DynamicSystem/bodeplot (line 108) Too many input arguments."
Why is this? When I used bodeplot on a transfer function previously, it worked just fine.

11 commentaires

Can you show your code where you define a plot the transfer function. Also, can you show the output of
which bodeplot
When I run which bodeplot it says
"C:\Program Files\MATLAB\R2019b\toolbox\shared\controllib\engine\@DynamicSystem\bodeplot.m % DynamicSystem method"
I get the same error for bode(H1s) and when I run which bode it says
"C:\Program Files\MATLAB\R2019b\toolbox\control\ctrlobsolete\bode.m"
my code for the transfer function:
s = tf('s');
H1s = (1/(8000*10^-8))*s/(s^2 + (1/(8000*10^-8))*s + 1/(0.01*10^-8))
h = bodeplot(H1s)
Stephan
Stephan le 18 Oct 2020
Modifié(e) : Stephan le 18 Oct 2020
On my R2020a it looks like this:
Note that I put both bode and bodeplot in my answer...
Stephan
Stephan le 18 Oct 2020
Modifié(e) : Stephan le 18 Oct 2020
My mistake... i edited my comment. Do you have installed the latest updates to your matlab installation? I ran your code on R2019b Update 5 - which gives a correct answer without any error messages.
I believe I have the latest updates. I even tried reinstalling matlab to fix.
I wonder if you bodeplot.m file somehow got edited. Can you run
edit bodeplot.m
and see if beginning of the file looks like this
function h0 = bodeplot(varargin)
%BODEPLOT Bode response plot of linear systems.
For reinstallation, did you delete the old files before reinstalling?
I do not think bodeplot.m got edited. In R2019b, line 108, the one that displays the error, is a throw() inside a try/catch block, so it is the appropriate line to show up in the error message if something goes wrong inside the try/catch including in calls to lower-level routines. So we need to figure out where the real error is.
At the MATLAB command line command give the command
dbstop if caught error
and run the code and it should stop at the line that has the real error.
I speculate that you have a third-party toolbox that is interfering with some call in a lower-level routine. I would suggest experimenting with
restoredefaultpath
rehash toolboxcache
and then running the code again. If it works that time, then something third-party is almost certainly involved.
With your advice I found out I had a file called "line.m" which superceded the function used by bode and several other functions. Thanks for the help.
Ah! That would do it.
Which toolbox had its own line.m ? line() is used by plot() so I would have expected a lot of plotting trouble.

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Get Started with Control System Toolbox dans Centre d'aide et File Exchange

Produits

Version

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by