📄 solve_chol.m
字号:
% solve_chol - solve linear equations from the Cholesky factorization.% Solve A*X = B for X, where A is square, symmetric, positive definite. The% input to the function is R the Cholesky decomposition of A and the matrix B.% Example: X = solve_chol(chol(A),B);%% NOTE: The program code is written in the C language for efficiency and is% contained in the file solve_chol.c, and should be compiled using matlabs mex% facility. However, this file also contains a (less efficient) matlab% implementation, supplied only as a help to people unfamiliar with mex. If% the C code has been properly compiled and is avaiable, it automatically% takes precendence over the matlab code in this file.%% Copyright (c) 2004, 2005, 2006 by Carl Edward Rasmussen. 2006-02-08.function x = solve_chol(A, B);if nargin ~= 2 | nargout > 1 error('Wrong number of arguments.');endif size(A,1) ~= size(A,2) | size(A,1) ~= size(B,1) error('Wrong sizes of matrix arguments.');endx = A\(A'\B);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -