clear all

%For loop to create a random matrix of size n x n 
c = 0;
for p = 100:100:1000
    H = rand(p);
    b = rand(p,1);
    c = c+1;
    [m,n] = size(H);
    H(:,n+1)= b;


    tic
    %For loop to row reduce the lower left corner of the matrix H (i and j are just counters).
    for i = 1:n
        H(i,:) = H(i,:)/H(i,i);
        for j =1:n-i
            H(i+j,:)= H(i,:)*H(i+j,i) - H(i+j,:);
        end
    end

    %For loop to row reduce the upper right corner of the matrix H (i and j are just counters).
    for j = 1:n
        for i = 1:n-j
            H(n-i+1-j,:) = H(n-i+1-j,:) - H(n+1-j,:)*H(n-i+1-j,n+1-j);
        end
    end
    time = toc; 
    
end
