필터 지우기
필터 지우기

How to solve ''Not enough input arguments'' error?

조회 수: 2 (최근 30일)
Arash
Arash 2022년 11월 10일
댓글: Arash 2022년 11월 10일
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

답변 (1개)

Voss
Voss 2022년 11월 10일
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.
  댓글 수: 1
Arash
Arash 2022년 11월 10일
Thank you for your answer. Yes, you are right, there is no problem when I run it from MATLAB commend, but when I run it from an M file, I have this problem, I mean the original genetic algorithm file . And I also set the initial values ​​of (p) in the main m. file. But there is still an error. I am attaching the file for more details.
Thank you

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Genetic Algorithm에 대해 자세히 알아보기

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by