How to create a function to get slope and y intercept
6 views (last 30 days)
Show older comments
I really new to MATLAB and I need to create a MATLAB function that computes the slope (a) and intercept (b) of a linear fit for the contained in arrays x and y, where x is the independent value and y is the dependent value. So my input would be the data (x,y), which gives me (a,b) I cannot use polyfit to figure this out, which is why I don't understand how to do it.
0 Comments
Answers (1)
See Also
Categories
Find more on Get Started with Curve Fitting Toolbox 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!