How to create a 4 dimensional array??
179 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Michael
le 1 Déc 2011
Commenté : Precious Chukwuezi
le 30 Déc 2023
This is just a general question because I can't find it anywhere, but does anyone know how to create a 4-D array? What would the basic code be for it or just a basic example of one would be great!
0 commentaires
Réponse acceptée
Walter Roberson
le 1 Déc 2011
Supposing A and B are 3 dimensional arrays, then cat(4,A,B) would join them along the fourth dimension.
1 commentaire
Jan
le 1 Déc 2011
This works for 2D arrays also, because they are just special 3D arrays. See: "cat(4, 1, 1)".
Plus de réponses (1)
the cyclist
le 1 Déc 2011
Modifié(e) : John Kelly
le 26 Fév 2015
Here is a trivial example:
>> A = zeros(2,3,5,7);
>> A(1,2,1,2) = 6;
>> A(1,1,5,6) = 5;
>> A(2,1,1,:) = pi;
3 commentaires
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!