Fibonacci
Version 1.0.0 (1,13 KB) von
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));
Zitieren als
Toby (2024). Fibonacci (https://www.mathworks.com/matlabcentral/fileexchange/74580-fibonacci), MATLAB Central File Exchange. Abgerufen .
Dasdan, Ali. Twelve Simple Algorithms to ComputeFibonacci Numbers. KD Consulting, 2018.
Kompatibilität der MATLAB-Version
Erstellt mit
R2012a
Kompatibel mit allen Versionen
Plattform-Kompatibilität
Windows macOS LinuxTags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Live Editor erkunden
Erstellen Sie Skripte mit Code, Ausgabe und formatiertem Text in einem einzigen ausführbaren Dokument.
Version | Veröffentlicht | Versionshinweise | |
---|---|---|---|
1.0.0 |