Making a Best Fit line with 0,0
Show older comments
So, I am in Engineering Physics 2. My lab partners and I have complied some data. Data is as follows
Capacitance = 1.0e-07 * [
0.1077
0.0669
0.0485
0.0379
0.0309
0.0272
0.0225
0.0194
0.0185
0.0164
0.0110
0.0081
0.0069]
and
InvDistance = [
20000
10000
6666.666667
5000
4000
3333.333333
2857.142857
2500
2222.222222
2000
1333.333333
1000
400]
So we plot it and then we tried doing a best fit like but our professor said the slope is incorrect and it needs have the intercept at (0,0). How do I make this best fit line change it's intercept to (0,0) so we can have a slope the professor agrees with?
Accepted Answer
More Answers (2)
Guillaume
on 17 Feb 2015
You're basically wanting to find m (the slope) in:
InvDistance = m * Capacitance;
Which you can solve in matlab with:
m = Capacitance \ InvDistance;
Latasha Cable
on 17 Feb 2015
0 votes
Categories
Find more on Line Plots 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!