Is there a built-in function to concatenate arrays in the third direction?
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Bruce Elliott
am 5 Jan. 2024
Kommentiert: Bruce Elliott
am 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 Kommentare
Akzeptierte Antwort
John D'Errico
am 5 Jan. 2024
Bearbeitet: John D'Errico
am 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 Kommentare
Dyuman Joshi
am 5 Jan. 2024
Some cats are like voids, you can only find them if they stare back at you.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Creating and Concatenating Matrices finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!