This is the function I ran for fibonacci numbers. It works well for small numbers but when you reach large ones matlab just turns "busy" and freezes up. I must use this program for the 10th, 50th, and 100th fibonacci numbers.
function f = fibonacci(n)if(n==1) f=1;elseif(n==2) f=1;else f = fibonacci(n-1) + fibonacci(n-2);end
Best Answer