chol函数

chol函数:
参考资料1

1.matlab里的解释

%CHOL   Cholesky factorization.
%   R = CHOL(A) calculates the Cholesky factor of full or sparse A using
%   the diagonal and upper triangle of A, such that A = R'*R. A must be
%   positive definite, and the lower triangle is assumed to be the (complex
%   conjugate) transpose of the upper triangle.
%
%   R = CHOL(A,TRIANGLE) specifies which triangle of A to use. For example,
%   if TRIANGLE is 'lower', then CHOL uses only the diagonal and lower
%   triangle of A to produce a lower triangular R such that A = R*R'. The
%   default value of TRIANGLE is 'upper'. Using the 'lower' option is
%   equivalent to calling CHOL with the 'upper' option and the transpose of
%   A, and then transposing the output matrix R. In the following syntaxes,
%   the output R is described only for the case when TRIANGLE is 'upper'.
%
%   [R,FLAG] = CHOL(___) also returns the output FLAG indicating whether A
%   is positive definite. Use this syntax to suppress errors produced when
%   A is not positive definite.
%   * If A is positive definite, then FLAG is 0 and R is the same as above.
%   * If A is not positive definite, then FLAG is a positive integer. 
%       - If A is full, then R is an upper triangular matrix of size
%         q = FLAG-1 such that R'*R = A(1:q,1:q). 
%       - If A is sparse, then R is an upper triangular matrix of size
%         q-by-n such that the L-shaped region of the first q rows and
%         first q columns of R'*R agree with those of A.
%
%   [R,FLAG,P] = CHOL(S), for sparse S, additionally returns a permutation
%   matrix P, which is a preordering of S obtained by AMD. The Cholesky
%   factor of P'*S*P tends to be sparser than that of S.
%   If FLAG = 0, then R is an upper triangular matrix such that R'*R = P'*S*P.
%
%   [R,FLAG,p] = CHOL(___,OUTPUTFORM) specifies whether to return the
%   permutation information as a vector p or matrix P. With this syntax you
%   must specify a sparse input matrix S, and you optionally can specify
%   TRIANGLE. For example, if OUTPUTFORM is 'vector' and FLAG = 0, then
%   S(p,p) = R'*R. The default value of OUTPUTFORM is 'matrix' such that
%   P'*S*P = R'*R.
%
%   See also CHOLUPDATE, ICHOL, LDL, LU.

%   Copyright 1984-2018 The MathWorks, Inc.
%   Built-in function.


2.中文解释

chol函数的功能是对正定矩阵做cholesky分解,求出它的上三角阵。

clc;clear;close all;
% chol函数说明
% R=chol(A)   ,A = R'*R.
A=[1,2,3;
   2,8,8;
   3,8,35];
A
R=chol(A);
R
R'*R



%上面程序的运行结果
A =

     1     2     3
     2     8     8
     3     8    35


R =

     1     2     3
     0     2     1
     0     0     5


ans =

     1     2     3
     2     8     8
     3     8    35
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值