Clear Filters
Clear Filters

Covert matrix to sub-matrices

2 views (last 30 days)
Jackson Barlow
Jackson Barlow on 6 Dec 2018
Answered: Bruno Luong on 6 Dec 2018
i have read a data file and received my 3003660x3 matrix, but these are various trials. is there any function that i can invoke to make this into 1476 separate 2035x3 matrices as that is the size of wach data set?

Answers (2)

Fangjun Jiang
Fangjun Jiang on 6 Dec 2018
reshape()

Bruno Luong
Bruno Luong on 6 Dec 2018
A = reshape(yourdata, [2035,1476,3]);
A = permute(A,[1 3 2]);
Now invoking:
A(:,:,k)
returns kth matrix of size (2035 x 3), for k=1, 2, .... 1476

Categories

Find more on Creating and Concatenating Matrices in Help Center and File Exchange

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!