Tag Info

Hot answers tagged

5

My defined function next find {nextpoint, nextdirection} value from {startpoint, startdirection} using NSolve. next[{sp_, sd_}][δ_] := Module[{sol, fp, fd}, sol = NSolve[{{x[φ, δ], y[φ, δ]} == sp + t sd, Abs[t] > 10^(-9), 0 <= φ < 2 π}, {t, φ}, Reals]; sol = If[Length[sol] > 0, sol[[1]]]; fp = {x[φ, δ], y[φ, δ]} /. sol; fd = ...


4

You need to randomize the control initial value, not the name of the symbol associated to the control. Perhaps this is what you want: Manipulate[ With[{f = Table[c[i], {i, n}], controls = Sequence @@ Table[{{c[i], s[i]}, -1, 1}, {i, n}]}, Manipulate[f, controls, Button["Random", Do[s[i] = RandomReal[{-1, 1}], {i, n}]]]], {n, {3, 4, 5}}, ...


1

Confirmed bug. Can't be fixed in 10.0.2 so we have to wait for next release.


1

Here's the solution I ended up going with: Manipulate[ With[{f = Table[c[i], {i, n}], controls = Sequence @@ Table[{{c[i], 0}, -1, 1}, {i, n}], randomize = Hold@CompoundExpression @@ Table[Hold[c[i] = RandomReal[{-1, 1}]] /. i -> j, {j, n}]}, Manipulate[Append[f, r], controls, {{r, 0}, -1, 1}, Button["Random", ...



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