Is there a built-in function to concatenate arrays in the third direction?
6 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Bruce Elliott
el 5 de En. de 2024
Comentada: Bruce Elliott
el 5 de En. de 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 comentarios
Respuesta aceptada
John D'Errico
el 5 de En. de 2024
Editada: John D'Errico
el 5 de En. de 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 comentarios
Dyuman Joshi
el 5 de En. de 2024
Some cats are like voids, you can only find them if they stare back at you.
Más respuestas (0)
Ver también
Categorías
Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!