Is there a built-in function to concatenate arrays in the third direction?
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Bruce Elliott
le 5 Jan 2024
Commenté : Bruce Elliott
le 5 Jan 2024
Is there an equivalent function to vertcat(..) and horzcat(..) but in the direction of a third index, e.g. pagecat(..)?
I always accomplish this by horizontally concatenating my arrays and then using permute(..), but it would be convenient to be able to do it with a single function call. Better still, add a third operator to "," and ";" as a shortcut to a pagecat(..) function, if there are any symbols left for that purpose.
0 commentaires
Réponse acceptée
John D'Errico
le 5 Jan 2024
Modifié(e) : John D'Errico
le 5 Jan 2024
Logically, one would just use cat. How might you have found this? READ THE HELP!
That is, near the end of the help for all MATLAB functions, they try to list functions which have similar abilities, are related in some way. That will be a see also line.
help horzcat
In the help for hirzcat, for example, you see the line,
See also vertcat, cat.
And while you know what vertcat does, what might cat do?
help cat
Try it out.
A = magic(3);
B = eye(3);
C = cat(3,A,B)
5 commentaires
Dyuman Joshi
le 5 Jan 2024
Some cats are like voids, you can only find them if they stare back at you.
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Creating and Concatenating 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!