Add for each element of a matrix the column vector in another dimension

1 次查看(过去 30 天)
Hi!i have a matrix 136*136 that for each cell contains a value. This value is the index of a column of another matrix(24*391) that is associated. Now i want associate for each cell(136*136) the column vector and obtain a multidimensional array.. Any ideas?

采纳的回答

Matt J
Matt J 2020-9-22
编辑:Matt J 2020-9-22
Hi!i have a matrix 136*136.
Call this A.
This value is the index of a column of another matrix(24*391)
Call this B. Then,
result=reshape( B(:,A).', 136,136,[]) ;
  3 个评论
Matt J
Matt J 2020-9-23
You're welcome, but please Accept-click the answer to indicate the issue is solved.

请先登录,再进行评论。

更多回答(0 个)

类别

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

产品


版本

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by