MATLAB: Failure in initial objective function evaluation. LSQCURVEFIT cannot continue.

curve fittingMATLAB

raw = xlsread('File', 2); % read in sheet number 2
Pc = raw(60:141, 1);
Sw = raw(60:141, 9);
plot(Sw,Pc,'ro')
F = @(x,xdata)1-x(1)*exp(-(x(2)/xdata)^(x(3)));
x0 = [3 6 0.6];
[x,resnorm,~,exitflag,output] = lsqcurvefit(F,x0,Sw,Pc)
I keep getting this error.
Error in Skelt_LS_Code (line 16)
[x,resnorm,~,exitflag,output] = lsqcurvefit(F,x0,Sw,Pc)
Caused by:
Failure in initial objective function evaluation. LSQCURVEFIT cannot continue.
Any help is appreciated. Thank you

Best Answer

F = @(x,xdata)1-x(1)*exp(-(x(2)./xdata).^(x(3)));