Optimisation error_constraint

6 vues (au cours des 30 derniers jours)
NN
NN le 9 Mai 2021
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;

Réponse acceptée

Matt J
Matt J le 9 Mai 2021
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".

Plus de réponses (0)

Catégories

En savoir plus sur Get Started with Optimization Toolbox dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by