Assigning random values to image pixels
19 次查看（过去 30 天）
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.