% Skript zur Musterlösung
%
% Numerische Mathematik, SS 2013
%
% Testen der LR-Zerlegung
%
% Ingolf Busch, Juni 2013

n = 1:100:1001;
time_zeile = zeros(size(n));
time_spalte = zeros(size(n));

time = zeros(5,1);

for i=1:length(n)
    for j=1:length(time)
        A = randn(n(i));
        tic;
        [L,R] = my_lr(A);
        time(j)=toc;
    end
    time_zeile(i)=mean(time);
    for j=1:length(time)
        A = randn(n(i));
        tic;
        [L,R] = my_lr2(A);
        time(j)=toc;
    end
    time_spalte(i)=mean(time);
end

plot(n,time_zeile,n,time_spalte);