Currently I'm playing around with dynamics and the NonlinearModelFit
function.
To be precise, I want to fit a function the data, which range I want to specify dynamically. This is not a problem and works fine. But when it comes to plotting, Mathematica refuses to show me anything.
Here's an example code (the testdata consists of 100 values. The variable min gives the lower bound for the fit to begin. )
min = 50;
testdata = Table[{x*RandomReal[{0.95, 1.05}], 3 x^2 + 4 x}, {x, 0, 10, 0.1}];
fit = Dynamic[NonlinearModelFit[testdata[[min ;;]], a x^2 + b x, {a, b}, x]];
Dynamic[Plot[fit[x], {x, 0, 4}]];
Do you have an idea, how to overcome this problem?
Thanks in advance, Juergen