create multidimensional array manually
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Olu adroit
le 15 Jan 2016
Réponse apportée : Walter Roberson
le 15 Jan 2016
Hi guyz, This may seem like a stupid question but please help me. I am trying to create a multidimensional matrix manually but i keep receiving an error message that ''subscripted assignment dimension mismatch'. E.g. i would like to create a 4x4x4 matrix like below. is this not suppose to give me 'myCA' as a 4x4x4 matrix? thanks for your help.
% code
myCA(:,:,1) = [2,2,5,2;2,2,2,2;2,2,2,2;2,2,2,2]
myCA(:,:,2) = [2,2,2,2;2,2,2,2;2,2,2,2;2,2,2,2]
myCA(:,:,3) = [2,2,2,2;2,2,2,2;2,2,2,2;2,2,2,2]
myCA(:,:,4) = [2,2,2,2;2,2,2,2;2,2,2,2;2,2,2,2]
0 commentaires
Réponse acceptée
Walter Roberson
le 15 Jan 2016
That code works fine pasted into the command line, provided that myCA is not already defined as something with a different shape.
You might also want to consider using cat(3, ....)
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Multidimensional 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!