function y = fib2(n)

    if n < 2
        y = n;
    else
        x = 0;
        y = 1;
        for i = 2 : n
            tmp = x + y;
            x = y;
            y = tmp;
        end
    end

end