Computes the generalized Fibonacci numbers as vectorized code.
Al momento, stai seguendo questo contributo
- Vedrai gli aggiornamenti nel tuo feed del contenuto seguito
- Potresti ricevere delle email a seconda delle tue preferenze per le comunicazioni
Fibonacci sequence
fibonacci.m
This is a simple GNU Octave/Matlab function to compute the Fibonacci sequence or numbers. Function is vectorized.
Syntax
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.
Examples
> fibonacci(7)
13
> fibonacci(0:10)
0 1 1 2 3 5 8 13 21 34 55
Documentation
Type doc fibonacci or help fibonacci for syntax and options. See also users comments and rating on .
References
https://en.wikipedia.org/wiki/Fibonacci_sequence
Author
Cita come
François Beauducel (2026). Fibonacci sequence (https://github.com/beaudu/fibonacci/releases/tag/v1.0), GitHub. Recuperato .
Riconoscimenti
Ispirato da: Fibonacci.m
Informazioni generali
Compatibilità della release di MATLAB
- Compatibile con qualsiasi release
Compatibilità della piattaforma
- Windows
- macOS
- Linux
| Versione | Pubblicato | Note della release | Action |
|---|---|---|---|
| 1.0 |
