[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
## Re: Curve fit

**From**: |
Andy Buckle |

**Subject**: |
Re: Curve fit |

**Date**: |
Sat, 20 Nov 2010 08:24:20 +0000 |

On Sat, Nov 20, 2010 at 7:43 AM, cunninghands <address@hidden> wrote:
>
>* I need help curve fitting my data, I do not know how since I am very new to*
>* Octave.*
(It probably would have been better to submit your data as an attachment.)
Here's an example fitting the model y = exp(a*x) + b to an
artificially created dataset:
-----------------------
b0 = 3;
a0 = 0.2;
x = 0:.5:5;
noise = 1e-5 * sin (100*x);
y = exp (-a0*x) + b0 + noise;
c_opt = [a0, b0];
tol = 1e-5;
[c, fval, info, output] = fsolve (@(c) (exp(-c(1)*x) + c(2) - y), [0, 0]);
-----------------------
Copied from Jaroslav
http://octave.1599824.n4.nabble.com/i-just-want-to-use-nonlinear-curve-fitting-function-what-should-i-do-td1633843.html
--
/* andy buckle */