Constraint problem in Problem-based optimization live task
조회 수: 1 (최근 30일)
이전 댓글 표시
hi, i'm trying to optimized an equation where the data used was in matrix. it is succesful when there is no constraint but the moment i apply a constraint it error as follows;
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1148145/image.png)
i saw one similar problem and was suggested to use fcn2optimexpr, and it exist in the code of define problem objective but not in the define problem constraint, which i cant edit the code that came from the live task.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1148150/image.png)
is there any solution on this? thankyou
댓글 수: 0
답변 (1개)
Walter Roberson
2022년 10월 7일
Notice that when you assign to problem.Constraints, you are asking to execute constraintFcn with those parameters, and the constraint that should be stored into problem.Constraints is whatever is returned by the constraintFcn.
댓글 수: 3
참고 항목
카테고리
Help Center 및 File Exchange에서 Problem-Based Optimization Setup에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!