
function [nV,avertt]=cpuLU

nV=2.^[0:14];

tests=5;

for ii=1:length(nV)
    n=nV(ii);
    A=rand(n,n);
    b=rand(n,1);
    tic;
    for jj=1:tests
       [L,U,P] = lu(A);
       c=P'*b;
       y=L\c;
       x=U\y;
    end
    tt=toc;
    avertt(ii)=tt/tests;
    
    tic;
    for jj=1:tests
       x=A\b;
    end
    tt=toc;
    avertt2(ii)=tt/tests;
    
    
    
    fprintf('\n \t $%5.0f$ & $%1.5e$ & $%1.5e$',n,avertt(ii),avertt2(ii))
end

fprintf('\n \n');