MATLAB: Image Tiling

image analysis

hi 2 all, Please give the example for mat2cell

Best Answer

doc mat2cell
example
>> A = randi([-345 367],5)
A =
235 -276 -233 -244 122
300 -147 347 -45 -320
-255 44 337 307 260
306 337 1 219 320
105 342 225 339 138
>> mat2cell(A,[4 1],[2 1 2])
ans =
[4x2 double] [4x1 double] [4x2 double]
[1x2 double] [ 225] [1x2 double]
>> ans{:}
ans =
235 -276
300 -147
-255 44
306 337
ans =
105 342
ans =
-233
347
337
1
ans =
225
ans =
-244 122
-45 -320
307 260
219 320
ans =
339 138
>>