Reshape a matrix into vector form and then again convert the array into previous dimensions matrix
7 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
akash bais
le 18 Mar 2017
Commenté : akash bais
le 18 Mar 2017
Suppose I have a matrix of size mxn and i want to convert it into an array and perform some operations on it and then later i want to regain the original matrix of same size mxn from that array
for e.g
A=[55 53 52 ;54 53 52 ;56 56 54];
array = 55 53 52 54 53 52 56 56 54
and then this array
array = 55 53 52 54 53 52 56 56 54
matrix
A=[55 53 52 ;54 53 52 ;56 56 54];
0 commentaires
Réponse acceptée
Walter Roberson
le 18 Mar 2017
array = reshape(A.', 1, [])
A = reshape(array, n, m).'
Notice this is not m, n.
3 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Resizing and Reshaping Matrices 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!