MPFITFUN AND PARINFO [message #48702] |
Wed, 17 May 2006 08:45  |
JJMeyers2
Messages: 12 Registered: October 2005
|
Junior Member |
|
|
Hello,
I am trying to use MPFITFUN to fit the sum of 2 Gaussians to my data. I
need both of the Gaussians to give curves with positive numbers because
a negative value will not make physical sense. When I run the MPFITFUN
it gives me 1 Gaussian that has all positive values and one Gaussian
that some values are negative. I tried to use PARINFO to costrain the
values for the second Gaussian but I think I am using it wrong.
Here is what I did:
guess_2g=[0.70,0.11,0.3,0.13,532.,1.]
parinfo(5).limited(0)=1.
parinfo(5).limits(0)=0.
fit=mpfitfun('twogauss',X,Y,1,guess_2g,PARINFO=parinfo)
and the error message i receive is:
% Expression must be a structure in this context: PARINFO.
% Execution halted at: fit.pro
I am only interested in constraining the last number for the guess
because that number gives the sign of the second Gaussian. I understand
that I will have to make an array like guess_2g for parinfo but I do
not want to do that because I want to the program to take the initial
values from guess_2g and just turn to parinfo only for the constraints
if it is needed.
Any suggestions on how to do that?
Thank you in advance,
JJM
|
|
|