Matlab - Maple Programming Help

Home : Support : Online Help : Mathematics : Numerical Computations : Matlab : Matlab/chol

Matlab

 chol
 compute the Cholesky factorization of a MapleMatrix or MatlabMatrix in MATLAB(R), where R'*R = X, and P is nonzero only if X is positive definite

 Calling Sequence chol(X) chol(X, output=R) chol(X, output=RP)

Parameters

 X - square MapleMatrix, or MatlabMatrix output - specify the form of the output (optional) R - return only unitary Q matrix RP - return Q and upper decomposed R matrix

Description

 • The commands Matlab[chol](X) and Matlab[chol](X, 'output'='R') use MATLAB® to compute the Cholesky factorization, R, of a MapleMatrix or MatlabMatrix, where transpose(R)*(R) = X. If X is not positive definite, then an error is returned.
 • When you specify the optional parameter, $'\mathrm{output}'='\mathrm{RP}'$, two values are returned.  The second value, P, is zero if X is positive definite; otherwise, P is 1+dimension(R).  The first value, R, is the largest dimension matrix such that transpose(R)*(R) = XX, where XX is the upper left corner of X, of dimension P.
 • For further details on the chol command, see the MATLAB® documentation.

Examples

 > $\mathrm{with}\left(\mathrm{Matlab}\right):$

Define the Maple matrix

 > $a≔\mathrm{Matrix}\left(\left[\left[1,0\right],\left[0,3\right]\right]\right)$
 ${a}{≔}\left[\begin{array}{rr}{1}& {0}\\ {0}& {3}\end{array}\right]$ (1)

Compute the factorization

 > $\mathrm{Matlab}[\mathrm{chol}]\left(a\right)$

 [1.            0.         ] [                         ] [0.    1.73205080756887720]

An example of the RP option

 > $b≔\mathrm{Matrix}\left(\left[\left[3,1,3,5\right],\left[1,6,4,2\right],\left[6,7,8,1\right],\left[3,3,7,3\right]\right]\right)$
 ${b}{≔}\left[\begin{array}{rrrr}{3}& {1}& {3}& {5}\\ {1}& {6}& {4}& {2}\\ {6}& {7}& {8}& {1}\\ {3}& {3}& {7}& {3}\end{array}\right]$ (2)
 > $r,p≔\mathrm{Matlab}[\mathrm{chol}]\left(b,'\mathrm{output}'='\mathrm{RP}'\right)$

 [1.73205080756887720    0.577350269189625842    1.73205080756887742] [                                                                  ] r, p := [        0.             2.38047614284761665     1.26025207562520891], 4. [                                                                  ] [        0.                      0.             1.84709629036559763]