I am trying to assign random values to the elements of a rectangular region within an image matrix, so that the result looks something like this:
This is my approach:
I = zeros(128,128);
I(i,j) = rand();
Is there a more efficient way of doing this, perhaps without a double for-loop?
Any suggestions would be greatly appreciated.