Cody

# Problem 752. Is X a Fibonacci Matrix?

Solution 2797069

Submitted on 6 Aug 2020
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   Fail
x = [0 1;1 1]; tf = true; assert(isequal(isFibMat(x),tf)) clear all;

Undefined function 'sym' for input arguments of type 'double'. Error in isFibMat (line 2) tf = any([det(sym(x)) ==1,det(sym(x)) ==-1]); Error in Test1 (line 3) assert(isequal(isFibMat(x),tf))

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

Undefined function 'sym' for input arguments of type 'double'. Error in isFibMat (line 2) tf = any([det(sym(x)) ==1,det(sym(x)) ==-1]); Error in Test2 (line 3) assert(isequal(isFibMat(x),tf))

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

Undefined function 'sym' for input arguments of type 'double'. Error in isFibMat (line 2) tf = any([det(sym(x)) ==1,det(sym(x)) ==-1]); Error in Test3 (line 3) assert(isequal(isFibMat(x),tf))

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

Undefined function 'sym' for input arguments of type 'double'. Error in isFibMat (line 2) tf = any([det(sym(x)) ==1,det(sym(x)) ==-1]); Error in Test4 (line 3) assert(isequal(isFibMat(x),tf))

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

Undefined function 'sym' for input arguments of type 'double'. Error in isFibMat (line 2) tf = any([det(sym(x)) ==1,det(sym(x)) ==-1]); Error in Test5 (line 3) assert(isequal(isFibMat(x),tf))

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

Undefined function 'sym' for input arguments of type 'double'. Error in isFibMat (line 2) tf = any([det(sym(x)) ==1,det(sym(x)) ==-1]); Error in Test6 (line 3) assert(isequal(isFibMat(x),tf))

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

Undefined function 'sym' for input arguments of type 'double'. Error in isFibMat (line 2) tf = any([det(sym(x)) ==1,det(sym(x)) ==-1]); Error in Test7 (line 3) assert(isequal(isFibMat(x),tf))

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

Undefined function 'sym' for input arguments of type 'double'. Error in isFibMat (line 2) tf = any([det(sym(x)) ==1,det(sym(x)) ==-1]); Error in Test8 (line 3) assert(isequal(isFibMat(x),tf))

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

Undefined function 'sym' for input arguments of type 'double'. Error in isFibMat (line 2) tf = any([det(sym(x)) ==1,det(sym(x)) ==-1]); Error in Test9 (line 3) assert(isequal(isFibMat(x),tf))

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

Undefined function 'sym' for input arguments of type 'uint8'. Error in isFibMat (line 2) tf = any([det(sym(x)) ==1,det(sym(x)) ==-1]); Error in Test10 (line 3) assert(isequal(isFibMat(x),tf))

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

Undefined function 'sym' for input arguments of type 'double'. Error in isFibMat (line 2) tf = any([det(sym(x)) ==1,det(sym(x)) ==-1]); Error in Test11 (line 3) assert(isequal(isFibMat(x),tf))

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

Undefined function 'sym' for input arguments of type 'double'. Error in isFibMat (line 2) tf = any([det(sym(x)) ==1,det(sym(x)) ==-1]); Error in Test12 (line 4) assert(isequal(isFibMat(x),tf))

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

Undefined function 'sym' for input arguments of type 'double'. Error in isFibMat (line 2) tf = any([det(sym(x)) ==1,det(sym(x)) ==-1]); Error in Test13 (line 3) assert(isequal(isFibMat(x),tf))

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

Undefined function 'sym' for input arguments of type 'double'. Error in isFibMat (line 2) tf = any([det(sym(x)) ==1,det(sym(x)) ==-1]); Error in Test14 (line 2) assert(true==isFibMat([0 1;1 1]^ii))