MATLAB Answers

"Too many input arguments" for basic operations on transfer functions

13 views (last 30 days)
Léo Bellorget
Léo Bellorget on 9 Jul 2020
Answered: Léo Bellorget on 16 Jul 2020 at 13:14
Hello,
I have a problem using the Control Model Toolbox that I never had before using Matlab R2019B.
Whenever I try to make some operations on transfer functions, I hace the same "Too many input arguments" problem.
For example :
>> s = tf('s');
>> s
s =
s
Continuous-time transfer function.
>> 2*s
Error using * (line 80)
Too many input arguments.
>> s+1
Error using + (line 63)
Too many input arguments.
>> s^2
ans =
s^2
Continuous-time transfer function.
>> tf(1,[1,1]) * tf(1,[1,2,1])
Error using * (line 80)
Too many input arguments.
As anyone ever met this problem ? My research hasn't led to any result.
Thanks

  0 Comments

Sign in to comment.

Accepted Answer

Léo Bellorget
Léo Bellorget on 16 Jul 2020 at 13:14
Actually, the reason was that I had a function called "conv" in my working directory. Renaming it solved the problem.

  0 Comments

Sign in to comment.

More Answers (1)

Steven Lord
Steven Lord on 9 Jul 2020
Make sure you haven't written your own mtimes.m or times.m file that's taking precedence over the built-in mtimes or times function. [I believe the mtimes method for tf may call times when the inputs are scalar.] What do you see when you run these commands?
which -all mtimes
which -all times

  3 Comments

Léo Bellorget
Léo Bellorget on 9 Jul 2020
Thanks for your answer. Here are the results of the mtimes and times commands :
>> which -all mtimes
built-in (C:\Program Files\MATLAB\R2019b\toolbox\matlab\ops\@char\mtimes) % char method
built-in (C:\Program Files\MATLAB\R2019b\toolbox\matlab\ops\@double\mtimes) % double method
built-in (C:\Program Files\MATLAB\R2019b\toolbox\matlab\ops\@int16\mtimes) % int16 method
built-in (C:\Program Files\MATLAB\R2019b\toolbox\matlab\ops\@int32\mtimes) % int32 method
built-in (C:\Program Files\MATLAB\R2019b\toolbox\matlab\ops\@int64\mtimes) % int64 method
built-in (C:\Program Files\MATLAB\R2019b\toolbox\matlab\ops\@int8\mtimes) % int8 method
built-in (C:\Program Files\MATLAB\R2019b\toolbox\matlab\ops\@logical\mtimes) % logical method
built-in (C:\Program Files\MATLAB\R2019b\toolbox\matlab\ops\@single\mtimes) % single method
built-in (C:\Program Files\MATLAB\R2019b\toolbox\matlab\ops\@uint16\mtimes) % uint16 method
built-in (C:\Program Files\MATLAB\R2019b\toolbox\matlab\ops\@uint32\mtimes) % uint32 method
built-in (C:\Program Files\MATLAB\R2019b\toolbox\matlab\ops\@uint64\mtimes) % uint64 method
built-in (C:\Program Files\MATLAB\R2019b\toolbox\matlab\ops\@uint8\mtimes) % uint8 method
C:\Program Files\MATLAB\R2019b\toolbox\control\ctrlmodels\@InputOutputModel\mtimes.m % InputOutputModel method
mtimes is a built-in method % connector.internal.LoggerLevel method
C:\Program Files\MATLAB\R2019b\toolbox\shared\controllib\engine\+ltipack\@tfdata\mtimes.m % ltipack.tfdata method
C:\Program Files\MATLAB\R2019b\toolbox\matlab\timefun\@duration\mtimes.m % duration method
C:\Program Files\MATLAB\R2019b\toolbox\matlab\datatypes\calendarDuration\@calendarDuration\mtimes.m % calendarDuration method
C:\Program Files\MATLAB\R2019b\toolbox\matlab\bigdata\@tall\mtimes.m % tall method
C:\Program Files\MATLAB\R2019b\toolbox\matlab\timeseries\@timeseries\mtimes.m % timeseries method
C:\Program Files\MATLAB\R2019b\toolbox\slcoverage\@cvdata\mtimes.m % cvdata method
>> which -all times
built-in (C:\Program Files\MATLAB\R2019b\toolbox\matlab\ops\@char\times) % char method
built-in (C:\Program Files\MATLAB\R2019b\toolbox\matlab\ops\@double\times) % double method
built-in (C:\Program Files\MATLAB\R2019b\toolbox\matlab\ops\@int16\times) % int16 method
built-in (C:\Program Files\MATLAB\R2019b\toolbox\matlab\ops\@int32\times) % int32 method
built-in (C:\Program Files\MATLAB\R2019b\toolbox\matlab\ops\@int64\times) % int64 method
built-in (C:\Program Files\MATLAB\R2019b\toolbox\matlab\ops\@int8\times) % int8 method
built-in (C:\Program Files\MATLAB\R2019b\toolbox\matlab\ops\@logical\times) % logical method
built-in (C:\Program Files\MATLAB\R2019b\toolbox\matlab\ops\@single\times) % single method
built-in (C:\Program Files\MATLAB\R2019b\toolbox\matlab\ops\@uint16\times) % uint16 method
built-in (C:\Program Files\MATLAB\R2019b\toolbox\matlab\ops\@uint32\times) % uint32 method
built-in (C:\Program Files\MATLAB\R2019b\toolbox\matlab\ops\@uint64\times) % uint64 method
built-in (C:\Program Files\MATLAB\R2019b\toolbox\matlab\ops\@uint8\times) % uint8 method
C:\Program Files\MATLAB\R2019b\toolbox\control\ctrlmodels\@DynamicSystem\times.m % DynamicSystem method
times is a built-in method % connector.internal.LoggerLevel method
C:\Program Files\MATLAB\R2019b\toolbox\shared\controllib\engine\+ltipack\@tfdata\times.m % ltipack.tfdata method
C:\Program Files\MATLAB\R2019b\toolbox\matlab\timefun\@duration\times.m % duration method
C:\Program Files\MATLAB\R2019b\toolbox\matlab\datatypes\calendarDuration\@calendarDuration\times.m % calendarDuration method
C:\Program Files\MATLAB\R2019b\toolbox\matlab\datatypes\categorical\@categorical\times.m % categorical method
C:\Program Files\MATLAB\R2019b\toolbox\matlab\bigdata\@tall\times.m % tall method
C:\Program Files\MATLAB\R2019b\toolbox\matlab\timeseries\@timeseries\times.m % timeseries method
% C:\Program Files\MATLAB\R2019b\toolbox\slcoverage\@cvdata\times.m% cvdata method
Léo Bellorget
Léo Bellorget on 9 Jul 2020
And here is the result of the plus and tf commands :
>> which -all plus
built-in (C:\Program Files\MATLAB\R2019b\toolbox\matlab\ops\@char\plus) % char method
built-in (C:\Program Files\MATLAB\R2019b\toolbox\matlab\ops\@double\plus) % double method
built-in (C:\Program Files\MATLAB\R2019b\toolbox\matlab\ops\@int16\plus) % int16 method
built-in (C:\Program Files\MATLAB\R2019b\toolbox\matlab\ops\@int32\plus) % int32 method
built-in (C:\Program Files\MATLAB\R2019b\toolbox\matlab\ops\@int64\plus) % int64 method
built-in (C:\Program Files\MATLAB\R2019b\toolbox\matlab\ops\@int8\plus) % int8 method
built-in (C:\Program Files\MATLAB\R2019b\toolbox\matlab\ops\@logical\plus) % logical method
built-in (C:\Program Files\MATLAB\R2019b\toolbox\matlab\ops\@single\plus) % single method
built-in (C:\Program Files\MATLAB\R2019b\toolbox\matlab\ops\@uint16\plus) % uint16 method
built-in (C:\Program Files\MATLAB\R2019b\toolbox\matlab\ops\@uint32\plus) % uint32 method
built-in (C:\Program Files\MATLAB\R2019b\toolbox\matlab\ops\@uint64\plus) % uint64 method
built-in (C:\Program Files\MATLAB\R2019b\toolbox\matlab\ops\@uint8\plus) % uint8 method
plus is a built-in method % string method
C:\Program Files\MATLAB\R2019b\toolbox\control\ctrlmodels\@InputOutputModel\plus.m % InputOutputModel method
plus is a built-in method % connector.internal.LoggerLevel method
C:\Program Files\MATLAB\R2019b\toolbox\shared\controllib\engine\+ltipack\@tfdata\plus.m % ltipack.tfdata method
C:\Program Files\MATLAB\R2019b\toolbox\matlab\strfun\@string\plus.m % string method
C:\Program Files\MATLAB\R2019b\toolbox\matlab\timefun\@datetime\plus.m % datetime method
C:\Program Files\MATLAB\R2019b\toolbox\matlab\timefun\@duration\plus.m % duration method
C:\Program Files\MATLAB\R2019b\toolbox\matlab\datatypes\calendarDuration\@calendarDuration\plus.m % calendarDuration method
C:\Program Files\MATLAB\R2019b\toolbox\matlab\bigdata\@tall\plus.m % tall method
C:\Program Files\MATLAB\R2019b\toolbox\matlab\timeseries\@timeseries\plus.m % timeseries method
C:\Program Files\MATLAB\R2019b\toolbox\slcoverage\@cvdata\plus.m % cvdata method
C:\Program Files\MATLAB\R2019b\toolbox\symbolic\symbolic\@sym\plus.m % sym method
which -all tf
C:\Program Files\MATLAB\R2019b\toolbox\control\ctrlmodels\@tf\tf.m % tf constructor
C:\Program Files\MATLAB\R2019b\toolbox\control\ctrlmodels\@DynamicSystem\tf.m % DynamicSystem method
C:\Program Files\MATLAB\R2019b\toolbox\shared\controllib\engine\+ltipack\@tfdata\tf.m % ltipack.tfdata method
C:\Program Files\MATLAB\R2019b\toolbox\ident\ident\@idParametric\tf.m % idParametric method
C:\Program Files\MATLAB\R2019b\toolbox\shared\controllib\engine\@StaticModel\tf.m % StaticModel method

Sign in to comment.