Cody

# Problem 752. Is X a Fibonacci Matrix?

Solution 96697

Submitted on 7 Jun 2012 by Roy Mathew
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;

tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1

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

tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0

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

tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1

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

tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0

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

tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1

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

tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0

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

tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0

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

tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0

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

tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0

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

tf = 0 tf = 0 tf = 0 tf = 0 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1 tf = 1

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

tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0

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

tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0

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

tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0 tf = 0

14   Fail

### Community Treasure Hunt

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

Start Hunting!