Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

code to draw a cellular topology consisting of 19 hexagonal cells and the rectangle

Status
Not open for further replies.

goldfish300

Newbie level 2
Newbie level 2
Joined
Mar 7, 2010
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,294
hi everyone,

i need help creating this shape that consists of 19 hexagonal cells and the rectangle as the following image shown below

19 hexa.PNG

i did try the following code but i don't know where i have to fix i tried a lot .

Code:
x_hexagon=[-1 -0.5 0.5 1 0.5 -0.5 -1];
y_hexagon=[0 -sqrt(3)/2 -sqrt(3)/2 0 sqrt(3)/2 sqrt(3)/2 0];

N=2;
M=2;

figure(1)
hold on
for nn=0:N
    for mm=0:M
        plot(x_hexagon+3*nn,y_hexagon+sqrt(3)*mm)
    end
end
for nn=0:N-1
    for mm=0:M-1
        plot(x_hexagon+1.5+3*nn,y_hexagon+sqrt(3)/2+sqrt(3)*mm)
    end
end
hold off
axis equal

thanks anyways for the help i appreciate that .
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top