I'm trying to build a pop up window with i lines. Each line would read:
Number of neurons in layer 1:
Number of neurons in layer 2:
etc until layer i
The user would enter a numeric value on each line. That value would be recorded as d[1],d[2],...,d[i]
.
The solution I've come up with results in Mathematica assigning the input from any line to d[i] (for example if there are 5 lines, it assign inputs from line 1, 2..5 all to d[5]
). I understand why it's happening. I just can't think of how I'm suppose to achieve what I want.
Here's my code:
a = Table[
List[StringJoin[{"Number of neurons in layer ", ToString[i], ":"}],
InputField[Dynamic[d[i]], Number]], {i, 3}];
AppendTo[a, {CancelButton[], DefaultButton[DialogReturn[]]}];
CreateDialog[Grid[a, Spacings -> {1, Automatic}, Alignment -> Left], Modal -> True];
Any suggestions? Thanks.
List[...]
) inTable
toWith[{i=i},List[...]]
. Please check this answer to a related question. $\endgroup$