Created
October 4, 2020 19:17
-
-
Save phabee/2f7deb04390dd9e45267e04918600831 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tic | |
fibonacci(30) | |
toc | |
function [n] = fibonacci(x) | |
if (x == 1 || x==0) | |
n = x; | |
else | |
n = fibonacci(x-1) + fibonacci(x-2); | |
end | |
return; | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Simple matlab script to calculate n-th fibonacci number using recursion.