Dear all,
When i use constraint which is defined as output in the function , no error, but when i use input variables in function it shows below error ,
Constraints must be an OptimizationConstraint or a struct containing OptimizationConstraints.what coudl be the reason
Please help the format
Code used is
prob.Constraints.data = price >=0;

 채택된 답변

Matt J
Matt J 2021년 5월 9일

0 개 추천

Whenever Matlab complains that a variable is the wrong type, you should look at the variable you've made and check what type it actually has. In this case, you could check that prob.Constraints are all of type "OptimizationConstraints".

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Problem-Based Optimization Setup에 대해 자세히 알아보기

질문:

NN
2021년 5월 9일

답변:

2021년 5월 9일

Community Treasure Hunt

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

Start Hunting!

Translated by