function fib = myfibonacci(n) % MYFIBONACCI calculate first n fibonacci numbers fib = ones(n, 1); for i = 3:n fib(i) = fib(i-1) + fib(i-2); end end