MathGroup Archive 2013

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Problem with function definition inside DynamicModule


I am not familiar with DynamicModule but here is a way to do the same thing using Manipulate:

showFit[myData_] := Manipulate[
   f = Fit[myData, Table[x^k, {k, 0, nn}], x];
   Show[
    ListPlot[myData,
     Joined -> False,
     PlotStyle -> {Red, AbsolutePointSize[7]},
     PlotRange -> All],
    Plot[f, {x, 0, 5}]
    ], {nn, {1, 2, 3, 4, 5}}
   ];

data = Table[{x, x^2 + RandomReal[{-1, 1}]}, {x, 0, 5}];
showFit[data]



  • Prev by Date: Re: Solve without vars
  • Next by Date: Re: Locators: Retrieve coordinates data to added locators
  • Previous by thread: Re: Problem with function definition inside DynamicModule
  • Next by thread: Solve without vars