Transforming a 3d array

3 vues (au cours des 30 derniers jours)
Chris Brown
Chris Brown le 1 Fév 2017
Commenté : Chris Brown le 1 Fév 2017
I have a 3D array that is 100x100x60, I also have a 3D array that is 100x60x100. Due to this I get the message 'Index exceeds matrix dimensions', when trying to perform further calculations. Is there a simple way to transform the second array to be 100x100x60?

Réponse acceptée

Stephen23
Stephen23 le 1 Fév 2017
Modifié(e) : Stephen23 le 1 Fév 2017
reshape(B,[100,100,60])
or
permute(B,[1,3,2])
where B is the second array. Note that the answer depends on how you want the data to be arranged inside the new array: you need to check this yourself.
  1 commentaire
Chris Brown
Chris Brown le 1 Fév 2017
Thank you!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Matrices and Arrays dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by