Least square fit, find coefficients
3 views (last 30 days)
Show older comments
Using the function
F(t)=a+(b/t)
and data points
t= 4,5,6,7,10
f=1.75,1.73,1.62,1.63,1.49
find the coefficients a and b of the model and calculate the value of the model at 8.0
I tried using polyfit,because it has worked on similar problems,but doesn't work on this.
Any idea?
0 Comments
Accepted Answer
David Hill
on 15 Mar 2021
t= [4,5,6,7,10];
f=[1.75,1.73,1.62,1.63,1.49];
p=polyfit(1./t,f,1);%it will work but you need to take reciprocal of t
0 Comments
More Answers (1)
Image Analyst
on 15 Mar 2021
I'd probably use fitnlm() to fit a curve. See attached demo where I fit data to a model equation Y = a * X .^ b + c. I find a, b, and c, but of course you could set b at -1 and find just a and c if you want.
0 Comments
See Also
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!