Hot answers tagged

6

You can also wrap the interval slider object with Style and use DefaultOptions to set PlotRangePaddding option values: s = IntervalSlider[Appearance -> {"ThumbAppearance" -> {Style["[", 18], None, Style["1000", 18]}}] Style[#, DefaultOptions -> {Graphics -> PlotRangePadding -> {{Automatic, .1}, Automatic}}] & @ s


6

You can tweak underlying Graphics: IntervalSlider[ Appearance -> {"ThumbAppearance" -> {Style["[", 18], None, Style["1000", 18]}} , BaseStyle -> { GraphicsBoxOptions -> { PlotRangePadding -> {{.1, .1}, Automatic} } } ]


6

ClearAll[functionList] functionList[n_] := Array[Symbol["x" <> ToString[#]][t] &, n] functionList[10] {x1[t], x2[t], x3[t], x4[t], x5[t], x6[t], x7[t], x8[t], x9[t], x10[t]} Also ClearAll[functionList2] functionList2[n_] := Through[Array[Symbol["x" <> ToString[#]] &, n] @ t] functionList2[10] {x1[t], x2[t], x3[t], x4[t], x5[...


5

This seems to fit your needs: Button[ Defer[1 + 1], FrontEndExecute[{ FrontEnd`SelectionMove[FrontEnd`EvaluationCell[], After, Cell], FrontEnd`NotebookWrite[FrontEnd`InputNotebook[], #, All], FrontEnd`SelectionEvaluateCreateCell[FrontEnd`InputNotebook[]] }] &, Evaluator -> None ]


2

In version 10.1 this sort of works, but the sliders are sticky; I have to click once to move them rather than click-and-drag. I recall having this problem before (with Slider, not HorizontalGauge) but I cannot recall the cause or solution. How does this behave in whatever version you are using? ClearAll[h] h[d_, opt___] := Dynamic[HorizontalGauge[d, opt]] ...


2

The equations can be constructed from the block diagram and then directly passed to NDSolve. eqns = {x'[t] == u[t] + f[t], f'[t] + f[t] == D[Power[x[t], 2], t]} /. u[t] -> 0.01 Sin[10 t]; x[t] /. NDSolve[Join[%, {x[0] == 0.5, f[0] == 0}], {x[t], f[t]}, {t, 0, 5}]; p1 = Plot[%, {t, 0, 5}]; Or we can use SystemsConnectionsModel to build the model and go ...


2

Here is one way to control the rate using a Checkbox control. Clear[delay, dt, flag, prev, x] dt = 1; flag = False; prev = AbsoluteTime[] ; x = 0; delay := If[AbsoluteTime[] >= prev + dt && flag, prev = AbsoluteTime[]; True, False] Row[{Checkbox[Dynamic[flag]], " Click to run"}] // Framed Dynamic[Refresh[If[delay, x = x + 1, x], ...


2

a = 0; Row[{Button["L", a += 1, ImageSize -> 60], Button["R", a += -1, ImageSize -> 60]}] Dynamic[a]


1

As confirmed by both WRI support and @ihojnicki, this is currently not possible. The front-end does not appear to be able to handle nested EventHandler expressions on its own. Quoting WRI support: ([CASE:4372001]) It does appear that Nested EventHandler is not behaving properly when all computations are moved to front-end. I have forwarded an issue ...


1

Following the comment by Kuba ♦ in the comment section, using Initialization solves my problem CDFDeploy["test01", Manipulate[ f[z], {z, 0, 10}, Initialization :> (f[x_] := x^2)]]


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