This solution is outdated. To rescore this solution, sign in.
-
2 Comments
Nabeel Ahmad
on 25 Oct 2019
function f = fib(n)
c =[1 2];
for i=1:n
c(i+2)=c(i)+c(i+1)
end
f=c(:,i)
end
could anybody please give me hint. I am struck here
f(1) fails. All other cases passed
Rui Zhao
on 24 Sep 2020
change c=[1 2] to c=[1 1]
Suggested Problems
-
5792 Solvers
-
3517 Solvers
-
1765 Solvers
-
1327 Solvers
-
15124 Solvers
More from this Author96
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!