lsqcurvefit error on a different computer

I tried to use lsqcurvefit to fit gamma variate function. It runs ok on my mac laptop with Matlab2015a installed, although it's really slow since that laptop only have two cores and I have 630784 pairs of data to fit. So, I decided to use a more powerful computer to run it at full speed (4 core). This is a Windows computer with Matlab2015b installed, the code ran successfully for about 20 min then it gave errors as shown below. I don't know why it runs fine on my laptop and failed on a different platform after it ran 20 mins. Any ideas? Thanks!
gma_var =@(x,xdata,varargin) x(1)*((xdata-x(2)).^x(3)).*exp(-(xdata-x(2))./x(4))...
.*(exp(1)/(x(3)*x(4))).^(x(3))+x(5);
parfor i = 1:num
gamma_fit(:,i) = lsqcurvefit(gma_var,k_reshaped(i,:),t,perfusion4D_reshaped(i,:))';
end
k_reshaped is a 333036x5 matrix and perfusion4D_reshaped is a 333036x29 matrix
Error using trust (line 29)
Input to EIG must not contain NaN or Inf.
Error in trdog (line 109)
[st,qpval,po,fcnt,lambda] = trust(rhs,MM,delta);
Error in snls (line 311)
[sx,snod,qp,posdef,pcgit,Z] = trdog(x,g,A,D,delta,dv,...
Error in lsqncommon (line 156)
snls(funfcn,xC,lb,ub,flags.verbosity,options,defaultopt,initVals.F,initVals.J,caller,
...
Error in lsqcurvefit (line 254)
lsqncommon(funfcn,xCurrent,lb,ub,options,defaultopt,caller,...

2 comentarios

Matt J
Matt J el 23 de Ag. de 2017
What are the values of the x and xdata when this occurs?
Matt J
Matt J el 23 de Ag. de 2017
It looks like your initial guess is wrong. Your initial guess should be 1x5 since you have 5 unknowns but k_reshaped(i,:) is 1x28160.

Iniciar sesión para comentar.

Respuestas (0)

Preguntada:

el 23 de Ag. de 2017

Editada:

el 23 de Ag. de 2017

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by