How to vertcat 100 matrices ?
Ältere Kommentare anzeigen
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 Kommentar
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:
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Creating and Concatenating Matrices finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!