I am trying to generate a tile image with random colors with matlab, very similar to this example, except with random colors.
Here’s my code:
Instead of a 5 by 5 tile of random colors, why do I get only one color?
for i=0:4
for j=0:4% Draw tile (i,j)
r = randi(255,1,3);
c = [r(1)/255, r(2)/255, r(3)/255];
fill([i i+1 i+1 i i],[j j j+1 j+1 j],c)
end
end
add
hold onto retain a current graph when adding new graphs, for example :