Your a is a read-in image, and the type may be uint8.
When it is divided into 10x 10 sub-blocks, it is still the type of uint8.
That is to say, in the cell cells in B, each cell is a matrix of uint8.
Finally, judge
When the condition is met and the matrix value changes, zero can specify the data type.
B{m, n} = zero (44,40,' uint8')
This should be no problem.
Also, in fact, it is not necessary to use those two double loops, and it is more efficient to use cellfun.