Skip to main content
Tweeted twitter.com/#!/StackMma/status/178179237289803776
added 66 characters in body
Source Link
Nothingtoseehere
  • 4.6k
  • 2
  • 32
  • 60

In the code below the value displayed next to the slider may be correct, and should be the result of The value of x for cyL and the value of x for change at the slider position. Slider position 0 should provide the first values for x in these lines. Now if I evaluate xoutside of the function after moving the sliders, it only returns the slider position and not the value of x from the function. How can I get the variable to return the correct value for each slider? Thanks!

cyL[x_] := 58.770000000000046` - 3.557000000000158` x - 3.525333333333144` x^2 + 4.987999999999908` x^3 - 1.3386666666666487` x^4; cyA[y_] := -35.13365403304179` - 0.009572400388682331` y + 0.08989310009715228` y^2 - 0.01687074829931251` y^3; change[x_] := -0.17006802721089645` + 62.92517006802724` x - 6.802721088435384` x^2; Column[{{Slider[Dynamic[x, Automatic]], Dynamic[cyL[change[x]]]}, {Slider[Dynamic[g, Automatic]], Dynamic[cyA[change[g]]]}}] 

In the code below the value displayed next to the slider may be correct, and should be the result of The value of x for cyL and the value of x for change at the slider position. Slider position 0 should provide the first values for x in these lines. Now x only returns the slider position and not the value of x from the function. How can I get the variable to return the correct value for each slider? Thanks!

cyL[x_] := 58.770000000000046` - 3.557000000000158` x - 3.525333333333144` x^2 + 4.987999999999908` x^3 - 1.3386666666666487` x^4; cyA[y_] := -35.13365403304179` - 0.009572400388682331` y + 0.08989310009715228` y^2 - 0.01687074829931251` y^3; change[x_] := -0.17006802721089645` + 62.92517006802724` x - 6.802721088435384` x^2; Column[{{Slider[Dynamic[x, Automatic]], Dynamic[cyL[change[x]]]}, {Slider[Dynamic[g, Automatic]], Dynamic[cyA[change[g]]]}}] 

In the code below the value displayed next to the slider may be correct, and should be the result of The value of x for cyL and the value of x for change at the slider position. Slider position 0 should provide the first values for x in these lines. Now if I evaluate xoutside of the function after moving the sliders, it only returns the slider position and not the value of x from the function. How can I get the variable to return the correct value for each slider? Thanks!

cyL[x_] := 58.770000000000046` - 3.557000000000158` x - 3.525333333333144` x^2 + 4.987999999999908` x^3 - 1.3386666666666487` x^4; cyA[y_] := -35.13365403304179` - 0.009572400388682331` y + 0.08989310009715228` y^2 - 0.01687074829931251` y^3; change[x_] := -0.17006802721089645` + 62.92517006802724` x - 6.802721088435384` x^2; Column[{{Slider[Dynamic[x, Automatic]], Dynamic[cyL[change[x]]]}, {Slider[Dynamic[g, Automatic]], Dynamic[cyA[change[g]]]}}] 
fixed mark up
Source Link
Heike
  • 36.2k
  • 3
  • 111
  • 158

In the code below the value displayed next to the slider may be correct, and should be the result of The value of xx for cyLcyL and the value of xx for change at the slider position. Slider position 0 should provide the first values for xx in these lines. Now xx only returns the slider position and not the value of xx from the function. How can I get the variable to return the correct value for each slider? Thanks!

cyL[x_] := 58.770000000000046 - 3.557000000000158 x - 3.525333333333144 x^2 + 4.987999999999908 x^3 - 1.3386666666666487` x^4;

cyA[y_] := -35.13365403304179 - 0.009572400388682331 y + 0.08989310009715228 y^2 - 0.01687074829931251 y^3;

change[x_] := -0.17006802721089645 + 62.92517006802724 x - 6.802721088435384` x^2;

Column[{{Slider[Dynamic[x, Automatic]], Dynamic[cyL[change[x]]]}, {Slider[Dynamic[g, Automatic]], Dynamic[cyA[change[g]]]}}]

cyL[x_] := 58.770000000000046` - 3.557000000000158` x - 3.525333333333144` x^2 + 4.987999999999908` x^3 - 1.3386666666666487` x^4; cyA[y_] := -35.13365403304179` - 0.009572400388682331` y + 0.08989310009715228` y^2 - 0.01687074829931251` y^3; change[x_] := -0.17006802721089645` + 62.92517006802724` x - 6.802721088435384` x^2; Column[{{Slider[Dynamic[x, Automatic]], Dynamic[cyL[change[x]]]}, {Slider[Dynamic[g, Automatic]], Dynamic[cyA[change[g]]]}}] 

In the code below the value displayed next to the slider may be correct, and should be the result of The value of x for cyL and the value of x for change at the slider position. Slider position 0 should provide the first values for x in these lines. Now x only returns the slider position and not the value of x from the function. How can I get the variable to return the correct value for each slider? Thanks!

cyL[x_] := 58.770000000000046 - 3.557000000000158 x - 3.525333333333144 x^2 + 4.987999999999908 x^3 - 1.3386666666666487` x^4;

cyA[y_] := -35.13365403304179 - 0.009572400388682331 y + 0.08989310009715228 y^2 - 0.01687074829931251 y^3;

change[x_] := -0.17006802721089645 + 62.92517006802724 x - 6.802721088435384` x^2;

Column[{{Slider[Dynamic[x, Automatic]], Dynamic[cyL[change[x]]]}, {Slider[Dynamic[g, Automatic]], Dynamic[cyA[change[g]]]}}]

In the code below the value displayed next to the slider may be correct, and should be the result of The value of x for cyL and the value of x for change at the slider position. Slider position 0 should provide the first values for x in these lines. Now x only returns the slider position and not the value of x from the function. How can I get the variable to return the correct value for each slider? Thanks!

cyL[x_] := 58.770000000000046` - 3.557000000000158` x - 3.525333333333144` x^2 + 4.987999999999908` x^3 - 1.3386666666666487` x^4; cyA[y_] := -35.13365403304179` - 0.009572400388682331` y + 0.08989310009715228` y^2 - 0.01687074829931251` y^3; change[x_] := -0.17006802721089645` + 62.92517006802724` x - 6.802721088435384` x^2; Column[{{Slider[Dynamic[x, Automatic]], Dynamic[cyL[change[x]]]}, {Slider[Dynamic[g, Automatic]], Dynamic[cyA[change[g]]]}}] 
Source Link
Nothingtoseehere
  • 4.6k
  • 2
  • 32
  • 60

Undocumented Dynamic Function question

In the code below the value displayed next to the slider may be correct, and should be the result of The value of x for cyL and the value of x for change at the slider position. Slider position 0 should provide the first values for x in these lines. Now x only returns the slider position and not the value of x from the function. How can I get the variable to return the correct value for each slider? Thanks!

cyL[x_] := 58.770000000000046 - 3.557000000000158 x - 3.525333333333144 x^2 + 4.987999999999908 x^3 - 1.3386666666666487` x^4;

cyA[y_] := -35.13365403304179 - 0.009572400388682331 y + 0.08989310009715228 y^2 - 0.01687074829931251 y^3;

change[x_] := -0.17006802721089645 + 62.92517006802724 x - 6.802721088435384` x^2;

Column[{{Slider[Dynamic[x, Automatic]], Dynamic[cyL[change[x]]]}, {Slider[Dynamic[g, Automatic]], Dynamic[cyA[change[g]]]}}]