File Exchange

image thumbnail

Gram-Schmidt orthogonalization

version 1.0 (1.69 KB) by

Gram-Schmidt orthogonalization



View License

This package implements the Gram-Schmidt algorithm and Modified Gram-Schmidt algorithm (MGS improve numerical stability over GS) for orthogonalizing or orthonormalizing vectors.
Gram-Schmidt algorithm factorizes a matrix X into two matrix Q and R, where Q is an orthogonal or orthonormal matrix and R is a upper triangular matrix and X=Q*R. The difference between orthogonal and orthonormal matrix is that for an orthonormal matrix, each column is orthogonal to others and has unit length.

This package contains following four functions:
gsog.m: Gram-Schmidt orthogonalization
gson.m: Gram-Schmidt orthonormalization which produces the same result as [Q,R]=qr(X,0)
mgsog.m: Modified Gram-Schmidt orthogonalization
mgson.m: Modified Gram-Schmidt orthonormalization which produces the same result as [Q,R]=qr(X,0)

This package is now a part of the PRML toolbox (

Comments and Ratings (0)

MATLAB Release
MATLAB 9.0 (R2016a)

Inspired by: Pattern Recognition and Machine Learning Toolbox

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video