| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Statistics Toolbox |
| Contents | Index |
| Learn more about Statistics Toolbox |
lsline
h = lsline
lsline superimposes a least-squares line on each scatter plot in the current axes. Scatter plots are produced by the MATLAB scatter and plot functions. Data points connected with solid, dashed, or dash-dot lines (LineStyle '-', '--', or '.-') are not considered to be scatter plots by lsline, and are ignored.
h = lsline returns a column vector of handles h to the least-squares lines.
Use lsline together with scatter plots produced by scatter and various line styles of plot:
x = 1:10; y1 = x + randn(1,10); scatter(x,y1,25,'b','*') hold on y2 = 2*x + randn(1,10); plot(x,y2,'mo') y3 = 3*x + randn(1,10); plot(x,y3,'rx:') y4 = 4*x + randn(1,10); plot(x,y4,'g+--') lsline

scatter, plot, refline, refcurve, gline
![]() | lt (qrandstream) | mad | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |