我也遇到了这个问题,结果出来的拟合参数是复数,我把程序写下,ChaChing帮我看下吧- y1=SM;
- w=fr;
- x1=[];
- initialCondition1=[1;1;1;1;1;1];
- [x1,resnorm1,residual1]=lsqcurvefit(@FD,initialCondition1,w,y1);
- vpa(x1,7);
- options=optimset('lsqcurvefit');
- options.MaxFunEvals = 10000000000000;
- lb=[0 0 0 0 0 0];
- ub=[0.1 5000 400 10000 10000 10000]
- [x11,resnorm11,residual11]=lsqcurvefit(@FD,initialCondition1,w,y1,lb,ub,options);
- vpa(resnorm11,9);
- vpa(x11,7);
- y11=real(FD(real(x11),w));
- loglog(w,y1,'*');hold on;
- loglog(w,y11,'-');
复制代码 用到的方程- function output = FD( x,fr )
- %UNTITLED Summary of this function goes here
- % Detailed explanation goes here
- output=x(1)+x(2)./(1+x(5).*(fr*i./x(3)).^(-x(6))+(fr*i./x(3)).^(-x(4)));
- end
复制代码 |