How do I get the value at a particular index?
112 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
So I have indices corresponding to values that I want. Is there a MATLAB function that would allow me to output the values when I input the indices of those values?
5 Kommentare
Luis J Gilarranz
am 1 Mär. 2020
Walter Roberson
am 1 Mär. 2020
Yes the techniques there are good, except I would not use the diag() one
Antworten (1)
Siriniharika Katukam
am 29 Okt. 2019
Hi
Consider A as the matrix, and x as indices, then
Values = A(x)
In case you need value of a 2-D matrix, define 'rowMatrix' which has the row indices and 'colMatrix' which has corresponding column indices, then
Values = A(rowMatrix, colMatrix)
0 Kommentare
Siehe auch
Kategorien
Mehr zu Matrix Indexing finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!