While running my function, I am getting following error. PLease help me
Error using fit>iFit (line 340)
Complex value computed by model function, fitting
cannot continue.
Try using or tightening upper and lower bounds on
coefficients.
Error in fit (line 108)
[fitobj, goodness, output, convmsg] = iFit(
xdatain, ydatain, fittypeobj, ...

댓글 수: 4

Walter Roberson
Walter Roberson 2018년 1월 20일
Which model are you fitting against? What is the range of your x and y data? Have you put in any range constraints?
Giru Mishra
Giru Mishra 2018년 1월 20일
편집: Matt J 2018년 1월 20일
Model is:
function y = lc(x,A,c,b,d)
y = zeros(size(x));
for i = 1:length(x)
y(i)=(-b)*(log10(x(i))-log10(c))+log10(A);
end
and then calling it as:
t = fittype('lc(x,A,c,b,d)')
f=fit(x,y,ft,'startpoint',[10 -4 1 2])
Giru Mishra
Giru Mishra 2018년 1월 20일
range of data is: x--> -4 to 6 y--> -5 to -2
Giru Mishra
Giru Mishra 2018년 1월 20일
and data is in log.. i.e. the data to be fitted is in log

댓글을 달려면 로그인하십시오.

 채택된 답변

Matt J
Matt J 2018년 1월 20일
편집: Matt J 2018년 1월 20일

0 개 추천

If c is allowed to be negative, then your model function will produce complex numbers via log10(c). Use the 'Lower' and 'Upper options to specify bounds.

추가 답변 (0개)

카테고리

도움말 센터 및 File Exchange에서 Model-Based Calibration Toolbox에 대해 자세히 알아보기

질문:

2018년 1월 20일

편집:

2018년 1월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by