[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: curvefit question



Mike Barker <animals@wam.umd.edu> wrote in message
Pine.GSO.4.21.0107111818550.4496-100000@rac4.wam.umd.edu">news:Pine.GSO.4.21.0107111818550.4496-100000@rac4.wam.umd.edu...
> Hello,
>
> I would like to fit the following function:
>
> y = m2*(x - x0) + m1*x0 + b1
>
> where m2 is the ONLY parameter to be fitted and m1, b1, x0 are
> variables (I DO NOT want to fit them).  I'm having trouble figuring out
> how to do this with curvefit (or any of the other built-in
> routines).  Curvefit won't let me pass m1, b1, and x0 as parameters.  I
> tried using a common block to store the variables but I still have to
> compile the function before I declare the common block.  If anyone could
> help I would be forever grateful.
>
> Sincerely,
> Mike
>

This is a BC answer (before coffee) so take it for what
its worth:

fit to
g = y - m1*x0-b1 = m2(x-x0)

hey, also change variables to (x' = x-x0)


Cheers,
bob  stockwell