Hot answers tagged

2

Rather than attempt to find the error, I rewrote the code - still using For-loops - to avoid the kernel crash and also to reduce runtime a bit. The result is Clear[F]; For[Liste2 = {}; ω = 0.3, ω <= 1, ω = ω + .01, For[Liste = {}; λ = 2*Pi/ω; Nz = 0, Nz <= 150, Nz++, F[t_?NumericQ] := Piecewise[{{2*t/λ, 0 < t <= λ/2}, {1, λ/2 < t <= ...


2

Look at your syntax. You are using comma instead of semicolon at the end of line. It should be like this: Liste = {}; \[Omega] = \[Omega] + 0.01; \[Lambda] = 2*Pi/\[Omega]; ...


1

You could either use $Pre or $Post together with a global variable to keep count of how many times a cell is evaluated: First you would initialize count and e.g. $Pre in s separate cell: count=0; $Pre = (If[EvenQ[count++], Print["checking"]]; #) &; Then the first cell evaluated will not print "checking". However, the second time you ...


Only top voted, non community-wiki answers of a minimum length are eligible