Least square fit, find coefficients

3 views (last 30 days)
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?

Accepted Answer

David Hill
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

More Answers (1)

Image Analyst
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.

Categories

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

Products


Release

R2020b

Community Treasure Hunt

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

Start Hunting!