gridview - A blank grid with a random green place in Matlab -


i created 100x100 lattice using code :

l=ones(101,1)*(1:101); i=2:101     j=1:101         l(i,j)=10*(i-1)+j;     end end m=l; x=randi([1 100]); y=randi([1 100]); m(x,y)=0; 

i want generate blank 100x100 grid case containing "0" in green.

note: tried method doesn't work

map1 = [1 1 1];  colormap(map1); pcolor(l)  map2 = [0 1 0]; colormap(map2); pcolor(m(x,y)) 

most of code good. need change last part

map2 = ones(max(m(:)),3); map2(1,:) = [0 1 0]; colormap(map2); pcolor(m); 

you need colormap represents of possible colros in map. si thats first line does, sets colors white. next line changes first element (wich correspond 0) green


Comments