next up previous contents
Next: The TONS implementation Up: The Fibonacci calculator Previous: The Perl implementation   Contents

The MatLab implementation

This code was run on the 5.1.0.421 version of MatLab for Linux.

function r = fib(n)
if( n > 2)
 r = fib(n-1) + fib(n-2);
else
 r = n;
end




1999-08-09