
function exampleQR

example=1;

switch example
    case 0
        A=[2 5; 1 1; 3 2]
        b=[1; 1; 1]
        
        x=A\b
        
        [Q,R]=qr(A)
        
        R'
        
        bb=A'*b
        y=R'\bb
        x=R\y
    case 1
        nV=2.^[0:7];
        
        tests=100;
        
        for ii=1:length(nV)
            n=nV(ii);
            A=rand(n,n);
            tic;
            for jj=1:tests
                [Q,R]=qr(A);
            end
            tt=toc;
            avertt(ii)=tt/tests;
            
         
            
            
            
            fprintf('\n \t $%5.0f$ & $%1.5e$ &',n,avertt(ii))
        end
        
end