how to plot hexagon inside boundary?
    7 次查看(过去 30 天)
  
       显示 更早的评论
    
采纳的回答
  dpb
      
      
 2022-8-11
        As a starting point...
N=6;
t=2*pi*(1/(2*N):1/N:1).';
x=cos(t);y=sin(t);
fill(x,y,'k')
axis square
hold on
hH=fill(x+2*max(x),y,'r');
axis square
ylim(xlim)
Those on the same row are obvious, the fillers in between need an adjustment of the x positon of only 1*x and of the height of the vertical side for y for the initial point -- then it's also tiled by 2X the X,Y position.
<fill> has a builtin replication routine that, I think, can be used to build the full array automagically, but I've not dug into just how to use it/how it works; there's not an example and didn't have time(*) to dig at the moment.
(*) Well, more like "inclination" would be more accurate... :)
2 个评论
  dpb
      
      
 2022-8-16
				I don't have the mapping toolbox to even try, sorry...all I know is what I showed before of how to generate the coordinates of a hexagon and offset set them one to another to tile them...
更多回答(0 个)
另请参阅
类别
				在 Help Center 和 File Exchange 中查找有关 Surface and Mesh Plots 的更多信息
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



