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
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
2020-9-23
You're welcome, but please Accept-click the answer to indicate the issue is solved.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!