In the context of automatic report generation, I am trying to use a For loop to Print out a number of Manipulate expressions.
I have made a simple example to illustrate the essence of the problem:
For[i = 1, i <= 3, i++,
Print[Manipulate[i, {t, 0, 1}]]
];
After evaluating this, the following is displayed:
However, I wish the value of a variable, in this case the momentary value of i, to persist in Manipulate. In this case, this would result in 1, 2, and 3 being displayed instead of 4, 4, and 4.
So far, I have tried using Initialization, Module, ReplaceAll, and Unique for this purpose, and surprisingly, nothing worked.
For example, this code yields the same result as the one above:
For[i = 1, i <= 3, i++,
Print[Manipulate[s, {t, 0, 1}, Initialization :> (s = i)]]
];


Manipulate's controltis in no way coupled to expression it displays in its content pane, there seems no reason at all to be usingManipulate. Can you come up with a better example where theManipulateexpression is actually relevant? – m_goldberg Feb 26 '16 at 00:54s+tinstead ofsas the first argument inManipulatein the second code (but that would distract from the fact that the value ofsdoes not persist in the sense I have described). I tried to make the example as simple as possible; that's one of the debugging strategies that I was taught and rely on. – Jake Feb 26 '16 at 01:17Manipulatehas aHoldAllattribute so this answers apply: Using pure functions in Table. Does this help? – Kuba Feb 26 '16 at 06:48