How to do curve fitting in my situation

3 views (last 30 days)
Yizhi
Yizhi on 9 Oct 2013
Commented: Matt J on 10 Oct 2013
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!

Answers (1)

Matt J
Matt J on 9 Oct 2013
LSQCURVEFIT, if you have it, would be applicable.
  3 Comments
Yizhi
Yizhi on 10 Oct 2013
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
Matt J
Matt J on 10 Oct 2013
Combine your unknowns into a single vector
x=[Js,H0,A,H1,H2,n,B,H3,H4]
and similarly with your data

Sign in to comment.

Categories

Find more on Get Started with Curve Fitting Toolbox in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!