% % testchol.m % % % Use the Cholesky decomposition decomposition % to solve a linear system with symmetric positive % definite matrix. % % A = [ 16 4 8 4 4 10 8 4 8 8 12 10 4 4 10 12]; b = [ 32 26 38 30 ]; disp( ' The system matrix A ') disp( A ) disp( ' and the right hand side vector b ') disp( b ) disp( ' The Cholesky decomposition computed using the Matlab CHOL command') disp( chol(A) ) disp( ' The Cholesky decomposition computed using MYCHOL') disp( ' (C is stored in the upper triangular part)') AA = A; [AA,iflag] = mychol( AA ); disp( AA )