Finding the value of chi-squared for a linear fit

6 views (last 30 days)
How do you use matlab to derive a formula for making a linear fit to data with an intercept at the origin so that y=bx and then apply it to your model to fit a straight line through the origin to the data given below
Assume uniform uncertainties σi= 1.5 in yi
The how do you find the value of chi-squared for the fit?
and the uncertainties in b and R^2.
Data:
xi= 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24
yi= 5.3, 14.4, 20.7, 30.1, 35.0, 41.3, 52.7, 55.7, 63.0, 72.1, 80.5, 87.9

Answers (1)

dpb
dpb on 21 Mar 2019
mdl=fitlm(xi,yi,'intercept',false);

Categories

Find more on Descriptive Statistics 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!