Fibonacci
Versione 1.0.0 (1,13 KB) da
Toby
Anonymous function to return the desired number(s) of the Fibonacci sequence. Function is zero-based; i.e. fib(0) = 0, fib(1) = 1, etc.
Anonymous function to return the desired number(s) of the Fibonacci sequence. Function is zero-based; i.e. fib(0) = 0, fib(1) = 1, etc.
fib = @(x) round(((1+sqrt(5))./2).^x./sqrt(5));
Cita come
Toby (2024). Fibonacci (https://www.mathworks.com/matlabcentral/fileexchange/74580-fibonacci), MATLAB Central File Exchange. Recuperato .
Dasdan, Ali. Twelve Simple Algorithms to ComputeFibonacci Numbers. KD Consulting, 2018.
Compatibilità della release di MATLAB
Creato con
R2012a
Compatibile con qualsiasi release
Compatibilità della piattaforma
Windows macOS LinuxTag
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Scopri Live Editor
Crea script con codice, output e testo formattato in un unico documento eseguibile.
Versione | Pubblicato | Note della release | |
---|---|---|---|
1.0.0 |