how can I remove this error??
信息
此问题已关闭。 请重新打开它进行编辑或回答。
显示 更早的评论
Undefined function or variable 'Constraint'.
pop=AddConstraint(1, pop, nPop, FA_time_slots, nVar, app_Sch_FA);
BestCost=repmat(firefly,MaxIt,1);
1 个评论
Walter Roberson
2017-6-20
In a duplicate of the posting, KSSV comments,
It says AddConstraint doen't accept Structure class. YOu are inputting structure. Check the help part of the function to know more about inputs.
回答(2 个)
Jan
2017-6-19
The error does not occur in the shown part of the code. Obviously it must be a line of code, which contains the term "Constraint" as a variable.
Use the debugger to find the cause of the problem:
dbstop if error
After typing this in the command line, run the code again. Now Matlab stops at the error and you can inspect the local workspace. Perhaps it is a typo only.
Note: Please post the complete error message in the future, which contains the failing line also.
0 个评论
Walter Roberson
2017-6-20
0 个投票
AddConstraint is not a Mathworks function.
With the particular capitalization "AddConstraint" as compared to "addConstraint", it appears that AddConstraint may be a routine from the SpringLab File Exchange contribution. However, that routine only accepts 5 parameters and you are passing in 6 parameters, and the parameters look to have very different purpose.
A google search on some of the variables you use does not find anything. We are led to the conclusion that you have probably written your own function to add constraints, but that it is either in a different directory, or you have used the wrong name for it, or you have not written it yet.
0 个评论
此问题已关闭。
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!