Re: MPCURVEFIT argument error [message #74901] |
Fri, 04 February 2011 08:36 |
pgrigis
Messages: 436 Registered: September 2007
|
Senior Member |
|
|
On Feb 4, 11:19 am, Josh Fuchs <fuchs.j...@gmail.com> wrote:
> Using MPCURVEFIT, I am getting the following error:
>
> % MPFIT: Error detected while calling MPFIT_FDJAC2:
> % MPFIT: POLY2: Incorrect number of arguments.
> % MPFIT: Error condition detected. Returning to MAIN level.
> % MPCURVEFIT: Error detected while calling MPFIT_FDJAC2: POLY2:
> Incorrect number of arguments.
>
> POLY2 is the function name called with MPCURVEFIT. POLY2 is a
> procedure based on POLY. I wrote POLY2 based on the following
> documentation for MPCURVEFIT, to make sure I did have the correct
> number of arguments:
>
> ; The user must define a function which returns the model value. For
> ; applications which use finite-difference derivatives -- the default
> ; -- the user function should be declared in the following way:
> ;
> ; PRO MYFUNCT, X, P, YMOD
> ; ; The independent variable is X
> ; ; Parameter values are passed in "P"
> ; YMOD = ... computed model values at X ...
> ; END
> ;
> ; The returned array YMOD must have the same dimensions and type as
> ; the "measured" Y values.
>
> Any thoughts about this? Thanks.
well either your poly2 does not have the right number of arguments
(double check that) or the version of poly2 that is compiled
is not what you think it is (explicitly compile it).
Try calling poly2 manually supplying x,p,ymod - does that work?
Ciao,
Paolo
|
|
|