convert a 3d matrix to 3 column vector

3 vues (au cours des 30 derniers jours)
AAS
AAS le 17 Sep 2020
Commenté : PS le 21 Sep 2020
Hi,
I have a matrix with x position as rows, y position as columns and magnitude as data at (x,y). How can I convert this to a 3 column matrix with (x,y, magnitude)
Thanks
  1 commentaire
madhan ravi
madhan ravi le 17 Sep 2020
Mind giving an example data?

Connectez-vous pour commenter.

Réponses (1)

AAS
AAS le 17 Sep 2020
Sorry,
I should rephrase my question. I have a matrix (magmatf- attached)- lets call the rows as R1 and columns and C1 . I created this using sub2ind and accumarray. Now I want to convert this back to a 3 column matrix with first two columns being the combinations of the (R1,C1)indices and the third column should be the value at R1(ind),C1(ind)
Thanks
  1 commentaire
PS
PS le 21 Sep 2020
Hi AAS,
Did you found the solution for it? I am also looking for something similar.
Thanks

Connectez-vous pour commenter.

Catégories

En savoir plus sur Matrices and Arrays 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!

Translated by