The conjugate gradient method aims to solve a system of linear equations, Ax=b, where A is symmetric, without calculation of the inverse of A. It only requires a very small amount of membory, hence is particularly suitable for large scale systems.
It is faster than other approach such as Gaussian elimination if A is well-conditioned. For example,
A=U*diag(s+max(s))*U'; % to make A symmetric, well-contioned
Conjugate gradient is about two to three times faster than A\b, which uses the Gaissian elimination.
Yi Cao (2022). Conjugate Gradient Method (https://www.mathworks.com/matlabcentral/fileexchange/22494-conjugate-gradient-method), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform CompatibilityWindows macOS Linux
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!