format compact
n = 9;
seed = 123;
rng(seed);

ti = zeros(1, n);
for i = 2:n
    A = rand(i, i);
    mydetermin(A); % pre-warm
    tic();
    d = mydetermin(A);
    ti(i) = toc();
    abs(d - det(A)) 
end

semilogy(2:n, ti(2:end), '.-')
grid on
xlabel('matrix size')
ylabel('t (sec)')
title('Timing for a naive determinant algorithm')
