My codes are shown in the picture attached.
I'm writing codes for numerical calculations frequently, and I think it looks neat and clear to organize input parameters in the form of table. For example,
calcTable=Grid[{{gridNum, tWindow, calcStepPerStep, dataSavingStep},
{8192, 200.*tPulse, 32, 32}}, Dividers -> All]
MapThread[Set, {#[[1, 1]], #[[1, 2]]}] & @ calcTable;
This would be displayed in a form of table in the frontend, and I can easily check and change every parameter.
However, if I want change some of the parameters displayed in the table after I have run the program once, warning appears, and no change of the values can be observed.
I think there must be some misunderstanding in the usage of Set
in the MapThread
. It can be seen that during the evalutation of
MapThread[Set, {#[[1, 1]], #[[1, 2]]}] & @
calcTable;
parameters such as {gridNum, tWindow, calcStepPerStep, dataSavingStep}
has been assigned with its value at the first place.
Actually, I'd like the evaluation performed in this way, first take {gridNum, tWindow, calcStepPerStep, dataSavingStep}
literrally, then use Set
to assigned values to them by MapThread
. I think this is closely related to nonstandard evaluation. But how can I achieve this?
Thank you very much.