Not enough input arguments with transfer function operations

Hi, I'm trying to use the Control System Designer to tune a simple PID controller. But when I open it, I get the following error:
Error using controlSystemDesigner (line 259)
Not enough input arguments.
This happens both by clicking the App icon and by calling It through the command line with or without a transfer function argument. The same happens with sisotool().
Trying to trace the error I noticed that I can no longer operate transfer functions. Running the following code,
>> s = tf([1 0], 1);
>> s*s
results in this error,
Error using * (line 80)
Not enough input arguments.
The same happens with any other transfer function operation. I tried unninstalling and reinstalling Matlab, but nothing changed. I'm currently using version 2021a.

 Accepted Answer

Maybe tf is shadowed on your path. Does the output of the which command look like this:
which tf -all
/MATLAB/toolbox/control/ctrlmodels/@tf/tf.m % tf constructor /MATLAB/toolbox/control/ctrlmodels/@DynamicSystem/tf.m % Shadowed DynamicSystem method /MATLAB/toolbox/ident/ident/@idParametric/tf.m % Shadowed idParametric method /MATLAB/toolbox/mpc/mpc/@mpc/tf.m % Shadowed mpc method /MATLAB/toolbox/shared/controllib/engine/@StaticModel/tf.m % Shadowed StaticModel method

6 Comments

This is what I get
/Applications/MATLAB_R2021a.app/toolbox/control/ctrlmodels/@tf/tf.m % tf constructor
/Applications/MATLAB_R2021a.app/toolbox/control/ctrlmodels/@DynamicSystem/tf.m % tunableGain method
/Applications/MATLAB_R2021a.app/toolbox/shared/controllib/engine/+ltipack/@tfdata/tf.m % ltipack.tfdata method
/Applications/MATLAB_R2021a.app/toolbox/shared/controllib/engine/+ltipack/@zpkdata/tf.m % ltipack.zpkdata method
/Applications/MATLAB_R2021a.app/toolbox/shared/controllib/engine/+ltipack/@ssdata/tf.m % ltipack.ssdata method
/Applications/MATLAB_R2021a.app/toolbox/shared/controllib/engine/+ltipack/@lftdataSS/lftdataSS.m % ltipack.lftdataSS method
/Applications/MATLAB_R2021a.app/toolbox/shared/controllib/engine/@StaticModel/tf.m % StaticModel method
/Applications/MATLAB_R2021a.app/toolbox/ident/ident/@idParametric/tf.m % idParametric method
/Applications/MATLAB_R2021a.app/toolbox/mpc/mpc/@mpc/tf.m % mpc method
Hmm, not sure why that output of which() is so much longer. What about this?
s = tf([1 0],1)
s = s Continuous-time transfer function.
whos s
Name Size Bytes Class Attributes s 1x1 1281 tf
which mtimes(s,s)
/MATLAB/toolbox/control/ctrlmodels/@InputOutputModel/mtimes.m % tf method
mtimes(s,s)
ans = s^2 Continuous-time transfer function.
Hmm, not sure why that output of which() is so much longer.
Probably they have some products installed that you do not or that are not available for use with the MATLAB session used by MATLAB Answers to evaluate code.
Sorry for the bad text formatting. It looks ok until the error.
whos s
Name Size Bytes Class Attributes
s 1x1 1281 tf
which mtimes(s,s)
/Applications/MATLAB_R2021a.app/toolbox/control/ctrlmodels/@InputOutputModel/mtimes.m % tf method
mtimes(s,s)
Error using * (line 80)
Not enough input arguments.
I managed to find the root of the problem!
I had defined a function file called conv.m without noticing that Matlab (or one of my installed packages) has a predefined conv function for convolutions. This seems to have caused some conflicts, resulting in the described issues.
Thanks for taking time to help me.
I'm pretty sure my installation has all products. Maybe something changed for 2022 on Answers compared to Tomas's version (unknown) and my local installation (2021b).
Why does answers show everything as "Shadowed" except the first output, which is not the case on Tomas's output or mine (see below)?
Any idea why Tomas's list shows a file lftdataSS.m, which isn't tf.m?
Here's what I get on my local installation:
>> ver Matlab
-----------------------------------------------------------------------------------------------------
MATLAB Version: 9.11.0.1769968 (R2021b)
-----------------------------------------------------------------------------------------------------
MATLAB Version 9.11 (R2021b)
>> which tf -all
C:\Program Files\MATLAB\R2021b\toolbox\control\ctrlmodels\@tf\tf.m % tf constructor
C:\Program Files\MATLAB\R2021b\toolbox\control\ctrlmodels\@DynamicSystem\tf.m % DynamicSystem method
C:\Program Files\MATLAB\R2021b\toolbox\shared\controllib\engine\+ltipack\@tfdata\tf.m % ltipack.tfdata method
C:\Program Files\MATLAB\R2021b\toolbox\ident\ident\@idParametric\tf.m % idParametric method
C:\Program Files\MATLAB\R2021b\toolbox\mpc\mpc\@mpc\tf.m % mpc method
C:\Program Files\MATLAB\R2021b\toolbox\shared\controllib\engine\@StaticModel\tf.m % StaticModel method
This output is kind of similar to Tomas's, but not the same. In particular, this list doesn't include the other +ltipack files, even though I actually have them. For example
>> exist('C:\Program Files\MATLAB\R2021b\toolbox\shared\controllib\engine\+ltipack\@ssdata\tf.m')
ans =
2
Any thoughts why my list doesn't show the other +ltipack files?

Sign in to comment.

More Answers (0)

Products

Release

R2021a

Community Treasure Hunt

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

Start Hunting!