function fibonacci = fib(n) f=[0,1]; for k=1:n f = [f(2), f(1)+f(2)]; end fibonacci=f;