Cody

Solution 2117476

Submitted on 4 Feb 2020 by Asif Newaz
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
A = [5 4 3;1 5 6;3 0 9]; a_correct = [1 0 0;0 1 0;0 0 1]; assert(isequal(Winner_takes_all(A),a_correct))

a = 3×3 logical array 1 0 0 0 1 0 0 0 1

2   Pass
A = [0.9572 0.1419 0.7922 0.0357; 0.4854 0.4218 0.9595 0.8491; 0.8003 0.9157 0.6557 0.9340]; a_correct = [1 0 0 0; 0 0 1 0; 0 1 0 1]; assert(isequal(Winner_takes_all(A),a_correct))

a = 3×4 logical array 1 0 0 0 0 0 1 0 0 1 0 1

Suggested Problems