PLEASE HELP ME find coresponding column indexes.
Mostrar comentarios más antiguos
I have a matrix V of size (3x3) and another matrix W (3x3), where off-diagonals are zero in matrix W and diagonals are non-zero. Then I have A=sort(diag(W)). Now I want to get the corresponding column index number from matrix W.
CODE IS GIVEN BELOW:
V= [3 4 5; 4 7 8;2 6 1];
W=[5 0 0;0 7 0;0 0 2];
A=sort(diag(W));
A =
2
5
7
Now i want the corresponding column index number. for example: in this problem first element is 2 and corresponding column index number 3 from matrix W. Similarly for 5 is 1 and for 7 is 2 respectively.
5 comentarios
Star Strider
el 4 de En. de 2015
‘Now i want to get the corresponding column index number from matrix W.’
Corresponding to what?
Stephen23
el 4 de En. de 2015
Please edit your question.
- Format the code so that it is readable (use the {} Code button above the text box)
- Describe the problem in more detail (as Star Strider has already pointed out)
- Don't put three sentences in the title.
- Read this:
palash de
el 4 de En. de 2015
Image Analyst
el 4 de En. de 2015
Editada: Image Analyst
el 4 de En. de 2015
Do you mean the rows and columns of V that correspond to values in A? Is so, why even bother to sort W? And what if the numbers in W don't appear in V? read this
Stephen23
el 4 de En. de 2015
Interestingly you don't refer to matrix V at all. Is this intentional?
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Matrices and Arrays en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!