2013-05-12 62 views

回答

5

转换的B列下标来线性索引,然后使用它们来参考元件在A

idx = sub2ind(size(A), (1:size(A, 1)).', B); 
C = A(idx); 

(有关详细信息,读关于线性索引的部分在this answer)。