Least-Squares optimal affine subspace

Computes the affine subspace (eg, line, plane) that optimally fits the input data

You are now following this Submission

The zip includes:
(1) lsqAffineSpace: a 'low level' routine that takes a set of m-dimensional real sample data and returns the optimal-fit k-dimensional affine subspace, with some options for discarding outliers.
(2) lsqPlane and lsqLine: lsqAffineSpace wrappers, that compute optimal line and hyperplane (plane, if the samples are 3-vectors) of the input samples.
(3) lsqAffineTestScript: demonstrating usage of the functions.

Cite As

Ofek Shilon (2026). Least-Squares optimal affine subspace (https://se.mathworks.com/matlabcentral/fileexchange/11920-least-squares-optimal-affine-subspace), MATLAB Central File Exchange. Retrieved .

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.0.0.0