"Too many input arguments" problem in ga, optimization toolbox. Can someone help help me?
3 views (last 30 days)
Show older comments
Luigi Treccozzi
on 28 Jan 2018
Commented: Asiye Ulas
on 17 Mar 2021
Hi guys. I'm using ga (Genetic Algorithm) toolbox. I'm not using code except for my fitness function and the generate initial population function (that, by the way, work since I tested them individually and they returned what I want). Now, the problem is that I can't start the algrithm because matlab always warns me that there are "Too many input argument". Any ideas?
I can add that even if I modify the fitness function and the input arguments (down to 2) matlab always says they are "too many", though I changed that parameter in the toolbox. Thanks
0 Comments
Accepted Answer
Sruthi Geetha
on 12 Feb 2018
GA is part of the Global Optimization Toolbox. However it is possible that you have another version of GA that is not shipped by the MathWorks.
Execute the following on your MATLAB command line to see all versions of GA on your installation:
>> which -all ga
If you see more than one output then you have some that are shadowed. If you would like to use the default GA please run the following:
>> restoredefaultpath
>> rehash toolboxcache
If the above does not help, please try the suggestions in the following link and see if any of that works for you: https://in.mathworks.com/matlabcentral/answers/4077-error-too-many-input-arguments
2 Comments
Mostafa Nakhaei
on 22 Jun 2020
Edited: Mostafa Nakhaei
on 22 Jun 2020
Thats worked for me. I had a file "ga.m" in my directory somewhere that was the culprit. It was suppressing the matlab "ga.m" file that was shipped with matlab originally. I simply changed my "ga.m" file to something else and it is working just fine.
Thank you so Much.
Mostafa
More Answers (0)
See Also
Categories
Find more on Genetic Algorithm in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!