function [F] = get_fib(k)get_fib(1) = 1;get_fib(2) = 1;get_fib(3) = 2;i = 3;k >= 0;while i<=k; [F] = get_fib(i-1) + get_fib(i-2); i = i + 1;end
MATLAB: What is wrong with the following while loop
fibonacci numbermatlab function
fibonacci numbermatlab function
function [F] = get_fib(k)get_fib(1) = 1;get_fib(2) = 1;get_fib(3) = 2;i = 3;k >= 0;while i<=k; [F] = get_fib(i-1) + get_fib(i-2); i = i + 1;end
Best Answer