Filter löschen
Filter löschen

indexing of a matrix

1 Ansicht (letzte 30 Tage)
deji
deji am 9 Nov. 2011
hi, i av a 200*3588 matrix and i want to index paired numbers from each column.is there a matlab function that will help me do it or do i av to do it manually? thanks in advance
  1 Kommentar
Fangjun Jiang
Fangjun Jiang am 9 Nov. 2011
Use a small matrix to explain what you need.

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 9 Nov. 2011
rowidx = [rowidx1, rowidx2, rowidx3, ... rowidx200];
matind = sub2ind(size(YourMatrix), [rowidx; 1+rowidx], repmat(1:size(YourMatrix,2), 2, 1) );
pairedValues = YourMatrix(matind);

Weitere Antworten (0)

Kategorien

Mehr zu Matrix Indexing finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by