writing a linprog command for this optimisation p
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I want to maximise a matrix x, the size of which is 5 × 5, for example. Subject to the following constraints:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1088780/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1088785/image.png)
I am confused about how I can represent these constraints as matrices. Each individual
represents an element of the matrix x, which is to be maximised? How do I go about this?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1088790/image.png)
3 commentaires
Torsten
le 5 Août 2022
What do you mean by "maximize a matrix" ?
Maybe
sum_{i=1}^{i=5} sum_{j=1}^{j=5} x_ij
?
John D'Errico
le 5 Août 2022
Maximizing a matrix is meaningless. You need to decide WHAT to maximize about that matrix. What is as large as is possible? Until you define what it is you need to do, there is nothing to do. As far as the constraints are concerned, just unroll the matrix into a vector of 25 elements, effectively using reshape. You have 9 linear inequality constraints that you have described. Each one of them is ONE constraint. You can write each of them as a linear inequality constraint involving 2 of the 25 unknowns in your matrix.
Réponses (0)
Voir également
Catégories
En savoir plus sur Nonlinear Optimization 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!