| 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 |
refline(m,b)
refline(coeffs)
refline
hline = refline(...)
refline(m,b) adds a reference line with slope m and intercept b to the current axes.
refline(coeffs), where coeffs is a two-element coefficient vector, adds the line
y = coeffs(1)*x + coeffs(2)
to the figure.
refline with no input arguments is equivalent to lsline.
hline = refline(...) returns the handle hline to the line.
Add a reference line at the mean of a data scatter and its least-squares line:
x = 1:10; y = x + randn(1,10); scatter(x,y,25,'b','*') lsline mu = mean(y); hline = refline([0 mu]); set(hline,'Color','r')

![]() | refcurve | regress | ![]() |

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 |