Welcome to yEd Q&A!
Here you can ask questions and receive answers from other members of the community and yEd developers. And you can tell us your most wanted feature requests.

Categories

How do I create a "for loop" in yEd?

0 votes

I want to use yEd to create the hexagon in this picture: http://i.imgur.com/jn6QX.png

It symbolizes a matlab "for loop". Is there any possible way to use yEd to create a hexagon with borders and different sections of text such as in this picture?

 

Thanks in advance!

in Help by (120 points)

1 Answer

0 votes

Yes, it is possible to create a node similar to the one in the linked picture.

Creating the three text labels:

  1. Use one of the two hexgonal nodes found in the "Shape Nodes" and "Flowchart" palette sections.
  2. Resize the node to e.g. 240x120.
  3. Add "k = 1" as the default text. Use "Internal: Topleft" as "Placement" and a "Distance" of e.g. 30.
  4. Use the node's context menu to add two additional labels for texts "k <= 100" and "k = k +1".
  5. Use "Internal: Right" and "Internal: Bottomleft" as placement and again a distance of 30. (To select a label, press and hold CTRL then left-click on the label text.)

Creating the vertical separator:

  1. Add yet another label with some dummy text.
  2. Select the label (CTRL+left-click).
  3. Use "Internal: Center" as placement.
  4. Set "Distance" to "0".
  5. Set "Background" to black.
  6. Set "Insets" to "0 1 0 1".
  7. Set "Size" to "Fit Node Height".
  8. Remove the label text.

Creating the horizontal separator:
Follow the approach for the vertical separator, but ...
... in step 3 use "Internal: Left",
... in step 6 use "1 60 1 60",
... and skip step 7.
 

Et voila, matlab for loop node.

Note, when changing the width of the node, you will have to adjust the horizontal separator's insets such that the sum of the second and fourth number equal one half the node's width.
 

by [yWorks] (134k points)
edited by
Legal Disclosure | Privacy Policy
...