Cody

# Problem 752. Is X a Fibonacci Matrix?

Solution 1623523

Submitted on 7 Sep 2018 by Jens Kjærgaard Boldsen
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test Status Code Input and Output
1   Pass
x = [0 1;1 1]; tf = true; assert(isequal(isFibMat(x),tf)) clear all;

2   Pass
x = [1 0;1 1]; tf = false; assert(isequal(isFibMat(x),tf)) clear all;

n = 2 tf = logical 0

3   Pass
x = [0 1;1 1]^40; tf = true; assert(isequal(isFibMat(x),tf)) clear all;

n = 40 tf = logical 1

4   Pass
x = [0 1;1 1]^40+1; tf = false; assert(isequal(isFibMat(x),tf)) clear all;

n = 40 tf = logical 0

5   Pass
x = [0 1;1 1]^17; tf = true; assert(isequal(isFibMat(x),tf)) clear all;

n = 17 tf = logical 1

6   Pass
x = [0 1;1 1]^17-5; tf = false; assert(isequal(isFibMat(x),tf)) clear all;

n = 17 tf = logical 0

7   Pass
x = [0 0 1;0 1 1;1 1 1]^3; tf = false; assert(isequal(isFibMat(x),tf)) clear all;

8   Pass
x = [0 0 1;0 1 1]; tf = false; assert(isequal(isFibMat(x),tf)) clear all;

9   Pass
x = [[0 1;1 1]^3 [5; 8]]; tf = false; assert(isequal(isFibMat(x),tf)) clear all;

10   Pass
x = uint8([0 1; 1 1]^5); tf = true; assert(isequal(isFibMat(x),tf)) clear all;

n = 5 tf = logical 1

11   Pass
x = -([0 1; 1 1]^5); tf = false; assert(isequal(isFibMat(x),tf)) clear all;

n = 5.0000 + 7.0000i tf = logical 0

12   Pass
x = [0 1; 1 1]^5; x(2) = nan; tf = false; assert(isequal(isFibMat(x),tf)) clear all;

n = NaN tf = logical 0

13   Pass
x = [4 7;7 11]; tf = false; assert(isequal(isFibMat(x),tf)) clear all;

n = 6 tf = logical 0

14   Pass
for ii = 1:55 assert(true==isFibMat([0 1;1 1]^ii)) end

n = 3 tf = logical 1 n = 4 tf = logical 1 n = 5 tf = logical 1 n = 6 tf = logical 1 n = 7 tf = logical 1 n = 8 tf = logical 1 n = 9 tf = logical 1 n = 10 tf = logical 1 n = 11 tf = logical 1 n = 12 tf = logical 1 n = 13 tf = logical 1 n = 14 tf = logical 1 n = 15 tf = logical 1 n = 16 tf = logical 1 n = 17 tf = logical 1 n = 18 tf = logical 1 n = 19 tf = logical 1 n = 20 tf = logical 1 n = 21 tf = logical 1 n = 22 tf = logical 1 n = 23 tf = logical 1 n = 24 tf = logical 1 n = 25 tf = logical 1 n = 26 tf = logical 1 n = 27 tf = logical 1 n = 28 tf = logical 1 n = 29 tf = logical 1 n = 30 tf = logical 1 n = 31 tf = logical 1 n = 32 tf = logical 1 n = 33 tf = logical 1 n = 34 tf = logical 1 n = 35 tf = logical 1 n = 36 tf = logical 1 n = 37 tf = logical 1 n = 38 tf = logical 1 n = 39 tf = logical 1 n = 40 tf = logical 1 n = 41 tf = logical 1 n = 42 tf = logical 1 n = 43 tf = logical 1 n = 44 tf = logical 1 n = 45 tf = logical 1 n = 46 tf = logical 1 n = 47 tf = logical 1 n = 48 tf = logical 1 n = 49 tf = logical 1 n = 50 tf = logical 1 n = 51 tf = logical 1 n = 52 tf = logical 1 n = 53 tf = logical 1 n = 54 tf = logical 1 n = 55 tf = logical 1