function f = Fib_Number(n_gen)
% Fib_Number - calc fibonacci nuber for the generation n_gen
%   f = Fib_Number(n_gen)
% Input: n_gen - Fibonacci index (generation)
% Note: here a standard definition (due to Wiki) is used:
%   index: 0 1 2 3 4 5 6 7 ...
%   F_ind: 0 1 1 2 3 5 8 13 ...



f1=1; f2=1;
if n_gen==1 || n_gen==0,
    f=f1*n_gen;
elseif n_gen==2,
    f=f2;
else
    for ii=1:n_gen-2,
        f=f1+f2;
        f1=f2;
        f2=f;
    end
end

