line equation from (x,y)
5 views (last 30 days)
Show older comments
Hi Friend I have 1000 x and y s . how i can find line equation for these points?
0 Comments
Answers (1)
Star Strider
on 4 Aug 2016
Edited: Star Strider
on 4 Aug 2016
For a linear fit, use the mldivide,\ operator:
b = [ones(size(x(:))) x(:)]\y(:);
slope = b(2)
intercept = b(1)
0 Comments
See Also
Categories
Find more on Mathematics and Optimization 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!