Interactive regression on a plot

Perform regression on plotted data in a figure by manually choosing the regression area.
518 Downloads
Updated 25 Aug 2010

View License

Plot data in a figure, and then interactively choose regression area. The result from polyfit is returned.
Example:
x=1:1:10;y=sin(x);
f=figure; plot( x,y );
[p,h] = figreg( f, 2 );
%fit a second order polynom to selected region in plot

Cite As

Ivar Eskerud Smith (2024). Interactive regression on a plot (https://www.mathworks.com/matlabcentral/fileexchange/28546-interactive-regression-on-a-plot), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2007b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Linear and Nonlinear Regression in Help Center and MATLAB Answers

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.0.0.0