nikozm
(nikos miridakis)
1
Hello,
i have a structure, which is of a form
Do[Module[{parameters initiation.....},
x=some function with respect to g];
Print[x], {g, {1, 2,3,4,5}}]
The above gives sequentially the solution in scalar values.
Instead, i would like to have the result (incrementally) in a list. How can this happen?
Thank you in advance
mthiel
(Marco Thiel)
2
You might want to look at the functions Sow/Reap or alternatively AppendTo.
Cheers,
M.
dreiss
(David Reiss)
3
Let’s say that your function is f[g] then
Map[f, Range[5]]
would give you want you want in your particular case
{f[1], f[2], f[3], f[4], f[5]}