arrays - Matlab : Reshaping Matrix to separate matrices -


i have matrix data. want reshape matrix 32 matrices of dimension 128x14.

4096/32

ans =     128 

size(data)

ans =

    4096          14 

how can using reshape?

it's simply:

out = reshape(data, 128, 14, 32); 

you 32 2d matrices placed 3d matrix each slice 128 x 14. aware of how matlab create matrix. elements populated in column major order, take columns of data matrix , stack them left right until 14 columns of 128. moves next slice in 3d matrix , picks left off until run out of elements.


Comments