I have two array 451×1 , I want to fit a line to a part of my data, for x=3.8 –4.1 , and I want to evaluate interception of fitted line with line y=0, Do you have any idea? (In matlab )

I have two array 451×1 , I want to fit a line to a
Share
You can easily perform a linear regression by indexing the points of the curve you want to use and passing them to the function POLYFIT. Here’s the code to do it and a plot of the fit line:
Then you can compute where this line intercepts the x-axis (i.e.
y = 0) like so: