Back to Problem Solutions forum
function [ p ] = fib( n ) %FIBBONACCI_A Summary of this function goes here % Detailed explanation for i=1:100000 if i==1; q(i)=0; elseif i==2; q(i)=1; else q(i)=q(i-1)+q(i-2); end if q(i)~=n p=-1; elseif q(i)==1 p=[1 2] return else p=i-1; return end end
Hello nurholisah!
Can you please do three things?