You are now following this Submission
- You will see updates in your followed content feed
- You may receive emails, depending on your communication preferences
Solves Ax=b using the conjugate gradient method. The matrix A should be symmetric and positive definite.
Usage (examples provided at end of m-file):
x=cgm(A,b);
If the matrix is sparse, it is worth trying:
x=cgm(sparse(A),b);
Cite As
Mark Holmes (2026). cgm(A,b) (https://nl.mathworks.com/matlabcentral/fileexchange/56208-cgm-a-b), MATLAB Central File Exchange. Retrieved .
General Information
- Version 1.1.0.0 (1.55 KB)
MATLAB Release Compatibility
- Compatible with any release
Platform Compatibility
- Windows
- macOS
- Linux
