How to extract sequential submatrices
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I have a 71617x15 matrix, named A. I need to create 13 new variables, each of them corresponding to a 5509x15 submatrix of A. The first submatrix has to made of the first 5509 rows and all columns of A; the second submatrix has to be made of the second 5509 rows (from 5510 to 11018) and all columns of A and so on until the last row of A. I was able to reach my purpose with one comand for each submatrix. How can I do that with a single comand?
0 Kommentare
Antworten (2)
Jos (10584)
am 25 Feb. 2019
Bearbeitet: Jos (10584)
am 25 Feb. 2019
Do not create 13 different variables, but store the result in 13 cells of a cell array, by applying MAT2CELL
0 Kommentare
madhan ravi
am 25 Feb. 2019
Don't create variables dynamically ( https://www.mathworks.com/matlabcentral/answers/304528-tutorial-why-variables-should-not-be-named-dynamically-eval ):
permute(reshape(yourmatrix.',15,5509,[]),[2 1 3])
0 Kommentare
Siehe auch
Kategorien
Mehr zu Multidimensional Arrays finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!