File Exchange

image thumbnail

Fibonacci.m

version 1.0.0.0 (387 Bytes) by David Terr
Given an integer n, return the nth Fibonacci number.

9 Downloads

Updated 08 Jun 2004

No License

Given an integer n, return the nth Fibonacci number.

Cite As

David Terr (2021). Fibonacci.m (https://www.mathworks.com/matlabcentral/fileexchange/5093-fibonacci-m), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (6)

ahmed

Shoyeb

Ragaar Ashnod

Was just playing around:
L34: If you make it an mpower operation this function can support vector inputs.

fib = round( alpha.^n / sqrt(5) );

mat kol

Yuko Bills

hemanth korrapati

very good site

MATLAB Release Compatibility
Created with R12
Compatible with any release
Platform Compatibility
Windows macOS Linux
Acknowledgements

Inspired: vectorized fibonacci

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!