0

I need to plot y using errorbar in matlab with error bars whose magnitude is the difference between y and the least squares fit. I have no idea how to find the magnitude.

y =

       60323
       61122
       60171
       61187
       63221
       63639
       64989
       63761
       66019
       67857
       68169
       66513
       68655
       69564
       69331
       70551

Can anyone help me how to do this in matlab or help me steer me in the right direction on where to start?

EdChum
  • 376,765
  • 198
  • 813
  • 562

1 Answers1

0

I think you could look for information about the fitting here: https://it.mathworks.com/help/curvefit/least-squares-fitting.html Once you have a vector ydata with the fitted data you could take the difference between y and ydata, and take the absolute value

enrico_ay
  • 76
  • 6