Tag Info

Hot answers tagged

4

It's much simpler f[g1_Graph] := DynamicModule[{pts = PropertyValue[{g1, #}, VertexCoordinates] & /@ VertexList@g1, g2 = g1}, {Dynamic@Column@pts, LocatorPane[Dynamic[pts], Dynamic[g2 = SetProperty[g2, VertexCoordinates -> pts]]]}] g = CompleteGraph[5, VertexLabels -> "Name", PlotRange -> {{-5, 5}, {-5, 5}}]; f@g


4

xp[t_, r_, t0_, x0_] := x[t] /. First[ NDSolve[{x'[t] + r x[t] == 0, x[t0] == x0}, x[t], {t, 0, 10}]]; Manipulate[ ClickPane[ Plot[g, {t, 0, 10}, PlotRange -> 1, Frame -> True, Epilog -> {PointSize[Large], Point[sp]}], (AppendTo[g, xp[t, r, #[[1]], #[[2]]]]; {t0, x0} = #; AppendTo[sp, #]) &], {{r, 1, "r"}, -10, 10, 0.01, ...


3

How about this? {Slider[Dynamic[a], {0, 10, 1}], Dynamic[a]} Dynamic[u = {a, a + 1}] Dynamic[u[[1]] + u[[2]]] Edit Regarding Kuba's comment So is pure code an educational answer then? No, of course it is not and most of my answers reflect that I care about this. Let me make some extensions to my answer by going through your examples and ...


2

You can use a list of points instead of individual controls and Manipulate will construct a LocatorPane to handle them. Not fussing much with the rest of the code, except to eliminate the global variables gr5 and coords: Manipulate[ With[{gr5 = Graph[el0, EdgeStyle -> LightGray, VertexCoordinates -> v, VertexLabels -> "Name", ImageSize ...


2

For a start I think you may need to use SetDelayed (:=) instead of Set (=). Then be careful with the spaces, a b c (the product of three different variables) is not the same as abc (a single variable). Then porbably you want something like this: ClearAll[a, b, c, d, e, f, g, h, i, j, k] Panel[Grid[{{Style["Inputs", Bold], SpanFromLeft}, {"a:", ...


2

I am answering my own question after a suggestion by MichaelE2 Here is a second version of dfit (dfit4) which has Sliders and TrackedSymbols. The sliders are a method of finding appropriate initial conditions. The solution to the problem is to include TrackedSymbols in the Dynamic that calculates the NonLinearModelFit. ClearAll[dfit4]; dfit4[data_] := ...


2

Ok, so without additional info, here's what you can use: TabView[{Manipulate[x, {x, 1, 10}], 2}, Dynamic[1, None]] TabView second argument determines the active tab but None action for Dynamic prevents from changing it.


2

Here's your code with fixes I've suggested in comments: DynamicModule[ {Location = {{0, 0, 0}, {0, 0, 0}}, pos10 = {{}, {}}, pos11 = {{0, 0, 0}, {0, 0, 0}}, pos12 = {{0, 0, 0}, {0, 0, 0}}, pos20, pos21 = {{0, 0, 0}, {0, 0, 0}}, pos22 = {{0, 0, 0}, {0, 0, 0}}, posInt, x, y, z, Chosen = 1}, posInt[] := ...


1

Here's an idea: update[p_, pi_, i_] := ReplacePart[p (1 - pi)/Total[Drop[p, {i}]], i -> pi]; Manipulate[ p, {{n, 3}, Slider[Dynamic[n, (n = #; p = ConstantArray[1./n, n]) &], {2, 10, 1}] &}, {{p, ConstantArray[1./3, 3]}, ControlType -> None}, Control[ {{p, ConstantArray[1./3, 3]}, Dynamic[ Column @ Table[With[{i = i}, ...


1

Not sure about general concept but maybe you can use this minimal example and extend/adjust to your needs: Grid[{{ ListPicker[ Dynamic[selectList, (selectList = #; re = Select[selectList, #[[3]] === "Yes" &]) &], dataImport] , Dynamic @ If[TrueQ[re === {}], "", {"Include ...


1

I'm sorry, I don't have time to address all issues in your code. But if you take a closer look at docs for things I'm using I'm sure you can understand what was wrong and why it works now. SetAttributes[ListPicker3, HoldFirst] ListPicker3[var_, list_] := DynamicModule[{temp = var, keycap}, DynamicWrapper[ ListPicker[Dynamic[temp], list], ...


1

Manipulate[ ClickPane[Plot[g, {t, 0, 10}, PlotRange -> x, Frame -> True], (AppendTo[g, Exp[-(t - #[[1]])]*#[[2]]]) &], {x, 1, 10}, Initialization :> {g = {}}]



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