% prof_test(1)
% prof_test(1)  --> error
% prof_test(2)  --> assertion failure
function prof_test(doprof)
    if (doprof)
        if (doprof==2)
            profile off
        end
        profile clear
        profile on
    end

    a = zeros(1000);
    for i=1:1000
        a(i) = a(1000-i+1);
    end

    if (doprof==2)
        profile off;
    end
end
