How to solve ''Not enough input arguments'' error?
3 views (last 30 days)
Show older comments
Actually, I worte a cost function for genetic algorithm to optimize fuzzy parameters. but when I run this algorithm it gives an error ''Not enough input arguments'' . I would appreciate it if you could guide me about this problem. and the error related to line 6 which is
a = floor(p(1:7));
Meanwhile, I attached a copy of cost function code. and to more information my fuzzy controller has 2 inputs which each of them has 7 memebership function between 0 to 1 and my outputs are 3 which each of them has 2 membership function in gaussmf between 0 to 1.
furthermore. my rules are 7*7
0 Comments
Answers (1)
Voss
on 10 Nov 2022
You'll get that error if you run the function by clicking the green Run arrow in the editor. The reason is that this function takes one input (p), which has not been provided.
To avoid this error, run the function from the MATLAB command line or from another function or script, and provide a value for p when you call it.
See Also
Categories
Find more on Genetic Algorithm in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!