MATLAB Answers

error of "Too many input arguments." in my program of PSO- PI controller program

2 views (last 30 days)
Anupam Ghosh
Anupam Ghosh on 9 Jun 2018
Commented: Walter Roberson on 28 Jun 2018
i m getting "Too many input arguments. " error while i am running the program for finding the optimum parameter values of fractional PI controller program.


Show 4 older comments
Walter Roberson
Walter Roberson on 24 Jun 2018
I used that same code for foft when I was debugging your program. By using that same code as you are using, I was able to locate the line in your code
which tries to invoke feedback with three input arguments -- first plant*cont, then 1, then t.
However, feedback() is not defined to accept three input arguments.
About three lines earlier in the code you had
which invoked feedback() with only two input arguments -- first plant*cost, then 1.
What was your intended difference in results between invoking
or invoking
? What did you expect different to happen when you passed in t as well as the other two arguments?
Anupam Ghosh
Anupam Ghosh on 28 Jun 2018
I have corrected the line to the above. but now when i run my program it is giving a new error saying "In the expression "M^K", the exponent K must be a scalar integer."
please suggest a solution.
Walter Roberson
Walter Roberson on 28 Jun 2018
You create
s = tf('s')
and you have
which tries to raise s to the exponent stored in L .
When you are using transfer functions, the exponent you use with ^ has to be a finite integer.
In your first call to havas to deal with the initial conditions, you used round() to ensure that all of the inputs were integers. However, when you are later looping and updating your x variables, you do not take any care to ensure that x(3) is a positive integer.

Sign in to comment.

Answers (1)

Walter Roberson
Walter Roberson on 9 Jun 2018
In the line
You are invoking feedback() with three input arguments. feedback() is only expecting two input arguments.
Just a few lines earlier you had invoked
which uses it with two input arguments.


Sign in to comment.

Community Treasure Hunt

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

Start Hunting!

Translated by