I try to create a table which will describe traffic paths at a crossroads. Instead of using copy-paste repeatedly, I would like to write a loop.
For example:
Grid[{
{Style["direction North", Bold]},
For[i = 1, i < 4, i++,
{Style["traffic path", Bold], i,
Labeled[InputField[Dynamic[data[[i, 1]]], Hold[Expression],
FieldSize -> 10], "Q", Left, LabelStyle -> Directive[Bold]],
Labeled[InputField[Dynamic[data[[i, 2]]], Hold[Expression],
FieldSize -> 10 ], "V", Left, LabelStyle -> Directive[Bold]],
PopupMenu[Dynamic[data[[i, 3]]], {1 -> "left", 2 -> "right",3 -> "straight "
}](*popup*)
} (*style*)
](*For*)
}](*Grid*)
I do not have much experience in Mathematica, so this straightforwardly-written loop doesn't work. I have read the manuals, but haven't found any information.
Tell me, please, what I'm doing wrong!
For[i = 1, i < 4, i++ , ...code.. ]toTable[ ...code... , {i,3}]. Getting yourDynamicconstructs to work is another matter.. – george2079 Jul 29 '15 at 18:56