How to vertcat 100 matrices ?
Mostrar comentarios más antiguos
Hi. Suppose I have 100 numbers of (m*3) matrices. These matrices have different numbers of rows and same numbers of columns. I want to add them vertically and use the vertcat command in Matlab. How can I do that? Thanks for your help.
1 comentario
Simply ensure that all of the matrices are stored in one cell array C, and then all you need to do is use a comma-separated list with vertcat:
M = vertcat(C{:})
MATLAB code can be so neat, simple, and efficient when people take care to design their data well!
Whatever you do, avoid magically creating/loading/acessing lots of separate variable names: this is a design decision that some beginners use to force themselves to write slow, complex, buggy, obfuscated code. Read more here:
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Creating and Concatenating Matrices en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!