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

1 vue (au cours des 30 derniers jours)
elena galvano
elena galvano le 22 Sep 2020
Commenté : Matt J le 23 Sep 2020
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
madhan ravi
madhan ravi le 22 Sep 2020
Any short examples?
elena galvano
elena galvano le 23 Sep 2020
The first matrix is an area (136*136), and for each cell i want to add a series of data (that is contained in the second matrix (24*391).

Connectez-vous pour commenter.

Réponse acceptée

Matt J
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
elena galvano
elena galvano le 23 Sep 2020
Ok, it's my fault! thank's
Matt J
Matt J le 23 Sep 2020
You're welcome, but please Accept-click the answer to indicate the issue is solved.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Produits


Version

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by