FUNCTION REFERENCE

lsqminnorm

Minimum-norm least-squares solution of a linear system.

Minimum-norm least-squares solution of a linear system.

Syntax

X = lsqminnorm(A, B)

Syntax

X = lsqminnorm(A, B, tol)

Syntax

X = lsqminnorm(A, B, ..., 'warn' | 'nowarn')

Returns the X of smallest norm among those minimising norm(A*X - B), also for rank-deficient A: X = pinv(A, tol) * B, keeping the singular values of A above tol (default max(size(A)) * eps(norm(A))). A and B need the same number of rows; X is size(A, 2)-by-size(B, 2).

Example

x = lsqminnorm([1 2; 2 4; 3 6], [1; 2; 3])   % [0.2; 0.4]

Example

x = lsqminnorm([1 0; 0 1; 1 1], [1; 2; 3], 'nowarn')   % [1; 2]

Differences from MATLAB: real full matrices only; uses the SVD rather than a complete orthogonal decomposition, and never warns about rank deficiency.

These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.