Add for each element of a matrix the column vector in another dimension
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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?
2 commentaires
Réponse acceptée
Matt J
le 22 Sep 2020
Modifié(e) : Matt J
le 22 Sep 2020
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 commentaires
Matt J
le 23 Sep 2020
You're welcome, but please Accept-click the answer to indicate the issue is solved.
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Logical dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!