Cholesky Decomposition is faster.
t1 = zeros(3,10); t2 = zeros(3,10); k=0; for N = 100:100:100+2*100
k=k+1 j=0; for N2 = 500:100:500+9*100 j=j+1 A=rand(N,N); A = A*A'+eye(N)*5; B = eye(N); c = rand(N,1); tmp=toc;for i=1:N2;solve_chol(A,B);solve_chol(A,c);end;t1(k,j)=toc-tmp; tmp=toc;for i=1:N2;L=chol(A,'lower');L'\(L\B);L'\(L\c);end;t2(k,j)=toc-tmp; end
end surf(t1) hold all surf(t2)