I have a 256*256 Matrix and I want to split it into 16 matrices (64*64). I know I can use mat2cell
, but how?
Asked
Active
Viewed 69 times
-1

Shai
- 111,146
- 38
- 238
- 371

Maziyar Grami
- 305
- 1
- 2
- 10
1 Answers
1
The documentation of mat2cell
is quite clear:
C = mat2cell( M, 64*ones(4,1), 64*ones(1,4) );

Shai
- 111,146
- 38
- 238
- 371
-
@MaziyarGrami So as to elaborate a little to this, you need to specify the matrix dimensions for each cell. Argument 1 is the matrix, argument 2 number of rows for the matrix of each cell, argument 3 number of columns for each cell. So for and m-by-n matrix, `sum(arg2)` is m and `sum(arg3)` is n. – patrik Mar 24 '15 at 10:40