Just thought I would add this in here...
It is possible to find the nth term of the Fibonacci sequence without using recursion. (A closed form solution exists.) I'm not necessarily expecting this answer to be accepted but just wanted to show it is possible to find the nth term of Fibonacci sequence without using recursion.
Try this function. I made this a long time ago. I also added some code to round the output to the nearest integer if the input is an integer. I found this is necessary because sometimes the rounding causes the closed form solution to not produce an integer due to the computer rounding the irrational numbers.
function x = fib(n)
%FIB Fibonacci sequence.
% X = FIB(N) returns the Nth term in the Fibonacci sequence, which is
% defined in the following way:
%
% FIB(N+2) = FIB(N+1) + FIB(N) , FIB(0) = 0 , FIB(1) = 1
%
% The closed form solution to the Fibonacci sequence is:
%
% N N
% / 1 + SQRT(5) \ / 1 - SQRT(5) \
% | ----------- | - | ----------- |
% FIB(N) = \ 2 / \ 2 /
% ------------------------------------
% SQRT(5)
%
% Although this formula is only physically meaningful for N as an
% integer, N can be any real or complex number.
r = sqrt(5);
x = (((1+r)/2).^n-((1-r)/2).^n)/r;
for l = numel(n)
if isequal(mod(n(l),1),0)
x(l) = round(x(l));
end
end
end