Cody

Solution 1916269

Submitted on 30 Aug 2019
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 = 5*ones(2,3); y_correct = logical(1); assert(isequal(checkIfequal(x),y_correct))

y = logical 0 ans = 6 ans = 3

Assertion failed.

2   Pass
x = magic(4); y_correct = logical(0); assert(isequal(checkIfequal(x),y_correct))

y = logical 0 ans = 1 ans = 4

3   Fail
x = zeros(4,4,4); y_correct = logical(1); assert(isequal(checkIfequal(x),y_correct))

y = logical 0 ans(:,:,1) = 16 ans(:,:,2) = 16 ans(:,:,3) = 16 ans(:,:,4) = 16 ans = 4

Assertion failed.

4   Pass
x = randn(3,3,3,3); y_correct = logical(0); assert(isequal(checkIfequal(x),y_correct))

y = logical 0 ans(:,:,1,1) = 1 ans(:,:,2,1) = 0 ans(:,:,3,1) = 0 ans(:,:,1,2) = 0 ans(:,:,2,2) = 0 ans(:,:,3,2) = 0 ans(:,:,1,3) = 0 ans(:,:,2,3) = 0 ans(:,:,3,3) = 0 ans = 3