indexing of a matrix

1 次查看(过去 30 天)
deji
deji 2011-11-9
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

采纳的回答

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

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Matrix Indexing 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by