MATLAB: Assigning white pixels to specific locations

pixelswhite

Say that we have a black image (i.e. zeros) of size 64×64, and say that I want to fill those 3×3 windows pixels in the middle of the image with white (i.e. ones), how can I do that in MATLAB?
Thanks.

Best Answer

I = zeros(64); I(32:35,32:35)=1;
Related Question