Cody

Problem 44481. How many Fibonacci numbers?

Solution 1417813

Submitted on 16 Jan 2018 by Kodavati Mahendra
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

This solution is outdated. To rescore this solution, sign in.

Test Suite

Test Status Code Input and Output
1   Pass
x = [1 4 5 7 10 11 13 20 21 23 29]; y_correct = 4; assert(isequal(fib_count(x),y_correct))

count = 0 count = 1 ans = 5 count = 2 ans = 13 count = 3 ans = 21 count = 4

2   Pass
x = 5:5:100; y_correct = 2; assert(isequal(fib_count(x),y_correct))

count = 0 count = 1 ans = 5 count = 2 ans = 55

3   Pass
x = [2 2 3 3 3 3 3 3 5 5 6 6 6 7 86168291600238450732788312165664788095941068326060883324529903470149056115823592713458328176574447204501]; y_correct = 4; assert(isequal(fib_count(x),y_correct))

count = 0 count = 1 ans = 2 count = 2 ans = 3 count = 3 ans = 5 count = 4 ans = 1×0 empty double row vector

Suggested Problems

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!