Vector ranking and transformation matrix
Afficher commentaires plus anciens
Hello. Suppose we have a vector [1 4 3], here -x1+x2>0, -x1+x3>0 and also x2-x3>0. How can we transform this ranking information into a matrix like [-1 1 0; -1 0 1; 0 1 -1]? Is there a function to realize it? Thank you in advance for your time and help.
2 commentaires
Stalin Samuel
le 21 Sep 2016
- Once you evaluate the below details you get the answer
- What is the values of x1,x2,x3 ?
- How do you relate the given vector with ranking information?
- What is the logic behind the final matrix?
Xia
le 21 Sep 2016
Réponse acceptée
Plus de réponses (1)
Steven Lord
le 21 Sep 2016
0 votes
If you're asking how to convert the inequalities (like -x1 + x2 < 0) into matrix form, I don't know if there's a function to do exactly that but the equationsToMatrix function comes close. You may be able to slightly modify your inequalities so they are equations then use equationsToMatrix to generate the matrices to use as your A, b, Aeq, and beq inputs to the Optimization Toolbox solvers (which is how I'm assuming you're planning to use those matrices.)
1 commentaire
Xia
le 21 Sep 2016
Catégories
En savoir plus sur Loops and Conditional Statements dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!