function f=fib(n)for i=1:nif i==1;f=1;elseif i==2f=1;elsef=fib(i-1)+fib(i-2);endendn=input('输入n');f=fib(n)