custom reshaping of multidimensional arrays
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I have a multidimensional array in the form VOLD(X,Y,TIME,Z,VAR) such as VOLD(128,128,25,17,4). How can I reshape the array in the most efficient and MATLAB-friendly way so that it is in the form VNEW(X,Y,Z,VAR,TIME) such as VNEW(128,128,17,4,25)?
There should be a better way than:
VNEW=zeros(128,128,17,4,25);
for i=1:25
for j=1:17
VNEW(:,:,j,1,i)=VOLD(:,:,i,j,1);
VNEW(:,:,j,2,i)=VOLD(:,:,i,j,2);
VNEW(:,:,j,3,i)=VOLD(:,:,i,j,3);
VNEW(:,:,j,4,i)=VOLD(:,:,i,j,4);
end
end
Thank you, Ahmad
0 commentaires
Réponse acceptée
Plus de réponses (0)
Voir également
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!