| Author |
Comment/Response |
simplexe
|
11/19/06 09:52am
Hi all.
Let's say I want to do a non linear least squares fit of exp(x) on interval [0.25, 5] with some combination of c_i x^i, i=0, .., n.
How can I do to set n=3 for example and perform the fit and then try again with another value for n (ie, only n changes and the set of parameters gets more c_i's) ??
I tried :
----------------------
data = Table[{x, Exp[x]}, {x, 0.25, 5, 0.025}];
n= 3;
n = 3;
NonlinearFit[data, NSum[c_i x^i, {i, 0, n}], x, Table[c_i, {i, 0, n} ]]
----------------------
But I only got errors .. ?
URL: , |
|