|
From: | Liam Groener |
Subject: | Re: Curve fit |
Date: | Mon, 22 Nov 2010 11:47:21 -0800 |
On Nov 22, 2010, at 6:34 AM, Martin Maxino wrote:
While the answers you got from James are correct, you could use the non-linear curve fit instead: [c,fval,info,output]=fsolve(@(c)(c(1)*exp(-c(2)*t)-x),[10;.1]); You don't really need to use .* in this case since the multiplications are between a vector and a scaler, not between two vectors. (In my emails to Cunninghands, I did put dots a couple of places where they were not really necessary. Sorry about that.) Whether you make the pre-exponential factor an unknown parameter (as in the example above) or a known constant depends on what you know for a fact. If you know the actual initial condition (as opposed to measuring it), just fit for one unknown parameter. In the example above, in the first guess for the parameters, [10;.1], you could use a measured value for c(1) in place of the 10. |
[Prev in Thread] | Current Thread | [Next in Thread] |