How to do curve fitting in my situation

function specialcurve = MagCurv(Js,H0,A,H1,H2,n,B,H3,H4)
specialcurve = @mfunc;
function J = mfunc(H)
J = Js*atan(H./H0)*2/pi.*(1-A*exp(-((H+H1)/H2).^n)).*(1-B*exp(-((log(H+eps)-...
log(H3))/log(H4)).^2));
end
end
Now I have raw data of H and J (array 1*23) and I want to get parameters(Js,H0,A,H1,H2,n,B,H3,H4) through curve fitting. Is that possible?
Thanks a lot!

답변 (1개)

Matt J
Matt J 2013년 10월 9일

0 개 추천

LSQCURVEFIT, if you have it, would be applicable.

댓글 수: 3

Yizhi
Yizhi 2013년 10월 10일
Thanks for replying! But how? I have my main function only delivering a handle of sub function and I have rawdata of H and J, both of them are array and used in sub function. But I need to get Js,H0,A,H1,H2,n,B,H3,H4 in the main function through curve fitting
Yizhi
Yizhi 2013년 10월 10일
I mean using of lsqcurvefit is that the function have a format of
J = myfunc(x,H)
where H and J is known and you use lsqcurvefit to get x
Combine your unknowns into a single vector
x=[Js,H0,A,H1,H2,n,B,H3,H4]
and similarly with your data

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

카테고리

도움말 센터File Exchange에서 Get Started with Curve Fitting Toolbox에 대해 자세히 알아보기

태그

질문:

2013년 10월 9일

댓글:

2013년 10월 10일

Community Treasure Hunt

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

Start Hunting!

Translated by