This is a simple GNU Octave/Matlab function to compute the Fibonacci sequence or numbers. Function is vectorized.
FIBONACCI(N) computes the Fibonacci number of N. N can be a scalar, vector or matrix of integers. Negative numbers are allowed (negafibonacci).
FIBONACCI without input argument returns the first 10 numbers of the Fibonacci sequence.
> fibonacci(7)
13
> fibonacci(0:10)
0 1 1 2 3 5 8 13 21 34 55
Type doc fibonacci
or help fibonacci
for syntax and options. See also users comments and rating on .