We can use the Least Squares Method to compute the coefficients (a and b) that provide the best fitting function for the given data. To solve this linear regression problem, we need to find a and b such that the sum of squared differences between the observed values and the predicted values is minimized. To find a and b, we need to solve the following equations:
main.m117 chars10 lines
The value at 13/2
can then be computed as a*(13/2) + b
.
Here's the MATLAB code:
main.m192 chars14 lines
The output value is -2.6782
.
gistlibby LogSnag