Is there a built-in function to concatenate arrays in the third direction?
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Bruce Elliott
il 5 Gen 2024
Commentato: Bruce Elliott
il 5 Gen 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 Commenti
Risposta accettata
John D'Errico
il 5 Gen 2024
Modificato: John D'Errico
il 5 Gen 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 Commenti
Dyuman Joshi
il 5 Gen 2024
Some cats are like voids, you can only find them if they stare back at you.
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Creating and Concatenating Matrices in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!