I have written a For loop in my Mathematica notebook. This For loop, when activated, will generate a sequence something like:
0.1
Null
0.3
0.4
Null
0.6
etc. The output solely consists of numbers and nulls.
What I want to do is plot these values generated by my For loop, using ListPlot. However, to use ListPlot I must first have a list, and the output of my For loop isn't in the form a list. How can I convert the output of my For loop into a list?
(Note: My For loop generates a large amount of numbers, so it is too laborious to manually enter these values into a list one by one).
My For loop is:
For[i = 0, i <1000, i++,
Print[
For[n = 100, n < 600, n++,
If[Abs[Nest[f, i*StepSize1, n] - 0.51304]<0.0001,
{Print[i* StepSize1], Break[]}, {Indeterminate, Break[]}]
]
]
]
StepSize is pre-defined, by the way.
Map
. $\endgroup$ – b.gates.you.know.what Nov 9 '12 at 19:45For[]
loops. Consider them as a last resource. $\endgroup$ – Dr. belisarius Nov 9 '12 at 19:48For
loops in Mathematica is that you don't useFor
loops =) $\endgroup$ – rm -rf♦ Nov 9 '12 at 19:52For
loops in Mathematica is that you do not useFor
loops ;-) $\endgroup$ – Chris Degnen Nov 9 '12 at 20:33