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
-
2348 Solvers
-
given 3 sides, find area of this triangle
808 Solvers
-
Sum of first n terms of a harmonic progression
454 Solvers
-
538 Solvers
-
487 Solvers
More from this Author96
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!