I have this code and I would like to get the correct y-intercept (and gradient) for my slope. You can see from the image generated that this function gives me the wrong intercept value. I have tried switching lat and long and I still cannot get the correct value. Does anyone know how I can amend this so it works?
I would also like to measure the fir of my data- Please can someone help me with that?
lat = [30.4056270000000;30.3991500000000;30.4000740000000;30.4046990000000;30.4102510000000;30.4093280000000;30.3889660000000;30.3982300000000;30.4074760000000;30.4195050000000;30.4139500000000;30.4120980000000;30.4083980000000;30.3936010000000;30.3926810000000];
Looks quite right to me...the intercept is where the fitted line will cross (intercept) the y-axis at x=0...that point is way and gone to the end of the earth (so to speak) to the left of your axis and with a negative slope of 0.11/degree latitude,
0.11*30 --> -3.3 and 40.76 - 3.3 --> 37.46
which is really close to what the interecept says it is exactly
As for the other question, read
and look at the second optional output, gof, the goodness of fit structure.