Optimisation error_constraint

4 ビュー (過去 30 日間)
NN
NN 2021 年 5 月 9 日
回答済み: Matt J 2021 年 5 月 9 日
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 日
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 件)

カテゴリ

Help Center および File ExchangeGet Started with Optimization Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by