Cody

Problem 43140. Odd times even numbers in a matrix

Solution 2064561

Submitted on 20 Dec 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 = 1; y_correct = 0; assert(isequal(oddXeven(x),y_correct))

a = 1 b = 1 y = 1

Assertion failed.

2   Fail
x = [1 2]; y_correct = 1; assert(isequal(oddXeven(x),y_correct))

a = 2 b = 2 y = 4

Assertion failed.

3   Fail
x = [1 2 3]; y_correct = 2; assert(isequal(oddXeven(x),y_correct))

a = 3 b = 3 y = 9

Assertion failed.

4   Fail
x = [1 2 3 4]; y_correct = 4; assert(isequal(oddXeven(x),y_correct))

a = 4 b = 4 y = 16

Assertion failed.

5   Fail
x = [1 2 4]; y_correct = 2; assert(isequal(oddXeven(x),y_correct))

a = 3 b = 3 y = 9

Assertion failed.

Suggested Problems

More from this Author25

Community Treasure Hunt

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

Start Hunting!