I only have code for creating one cell (but i need 2 cells). Here are the code:
% Program1 (Single Hexagonal Cell)
% Draw a hexagonal cell
function Drawhex1(x_init,y_init,cell_radius)x_init = 0;%Set initial x-coordinate to 0
y_init = 0;%Set initial y-coordinate to 0
cell_radius = 1;%Set cell radius equal to 1km
% Location of 6 edges in a hexagonal cell
bs_xloc(1)= x_init+cell_radius;bs_xloc(2)= x_init+cell_radius*cos(pi/3);bs_xloc(3)= x_init+cell_radius*cos(2*pi/3);bs_xloc(4)= x_init-cell_radius;bs_xloc(5)= x_init+cell_radius*cos(4*pi/3);bs_xloc(6)= x_init+cell_radius*cos(5*pi/3);bs_xloc(7)= x_init+cell_radius;bs_yloc(1)= y_init;bs_yloc(2)= y_init+cell_radius*sin(pi/3);bs_yloc(3)= y_init+cell_radius*sin(pi/3);bs_yloc(4)= y_init;bs_yloc(5)= y_init+cell_radius*sin(4*pi/3);bs_yloc(6)= y_init+cell_radius*sin(4*pi/3);bs_yloc(7)= y_init;bs_pos=[bs_xloc' bs_yloc'];%location of all 6 edges
plot(bs_pos(:,1),bs_pos(:,2),x_init,y_init,'^r');%Plot from 1 edge to another
hold on
% draw handover boundary
circle=rsmak('circle',0.8134,[x_init,y_init]);fnplt (circle)hold off
Can someone help me please? Thank you in advanced.
Best Answer