concept-collection / jupyterlite-numbl-kernel
jupyterlite-numbl-kernel / demo / content / fib.m
8 lines · 158 BBlameHistoryRaw
1function y = fib(n)
2% Recursive Fibonacci. Named functions live in .m files, not in cells.
3if n <= 2
4 y = 1;
5else
6 y = fib(n - 1) + fib(n - 2);
7end
8end