This is the result that I want. The number of bits resolution are 256 x 256.
256 x 256
// assign default background to white. img = ones(256, 256);
You are looking for the triu function
img = triu( ones( 256 ), 1 );