Colored Hexagons using Patch
25 views (last 30 days)
Hi to everyone, I was trying to make a honeycomb with Matlab, I've had no problem with the structure but I've some trouble trying to colour those hexagons with some defined color (e.g. red, blue and violet). This is the way I get the hexagons:
for i=1:4; x=x+v*2; a(i,:)=x; b(i,:)=y; %Create the row
for j=1:4; e=d+1.5*j; re=rem(j,2); %Create the columns
if re==0, g=c;
But the colour is not specified by me, but is randomly chosen from 0 to 1.
I've read the help but I don't get the point.
Thanks in advance to everyone!!