Cody

Solution 1973851

Submitted on 13 Oct 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
A = [1 2; 3 4]; L = logical(eye(2)); S_correct = [1 4]; assert(isequal(columnwise_logical_sums(A, L), S_correct))

ans = 1 4

Output argument "S" (and maybe others) not assigned during call to "columnwise_logical_sums". Error in Test1 (line 3) assert(isequal(columnwise_logical_sums(A, L), S_correct))

2   Fail
A = triu(ones(3)); L = logical(triu(ones(3))); S_correct = 1:3; assert(isequal(columnwise_logical_sums(A, L), S_correct))

ans = 1 4 5 7 8 9

Output argument "S" (and maybe others) not assigned during call to "columnwise_logical_sums". Error in Test2 (line 3) assert(isequal(columnwise_logical_sums(A, L), S_correct))

3   Fail
A = repmat(1:3, 3, 1); L = [false(3,1) true(3,2)]; S_correct = [0 6 9]; assert(isequal(columnwise_logical_sums(A, L), S_correct))

ans = 4 5 6 7 8 9

Output argument "S" (and maybe others) not assigned during call to "columnwise_logical_sums". Error in Test3 (line 3) assert(isequal(columnwise_logical_sums(A, L), S_correct))

4   Fail
A = 1:5; L = logical([0 1 0 1 0]); S_correct = [0 2 0 4 0]; assert(isequal(columnwise_logical_sums(A, L), S_correct))

ans = 2 4

Output argument "S" (and maybe others) not assigned during call to "columnwise_logical_sums". Error in Test4 (line 3) assert(isequal(columnwise_logical_sums(A, L), S_correct))

5   Fail
A = (1:5).'*(1:5); L = logical(diag(ones(1,4),-1)); S_correct = [2 6 12 20 0]; assert(isequal(columnwise_logical_sums(A, L), S_correct))

ans = 2 8 14 20

Output argument "S" (and maybe others) not assigned during call to "columnwise_logical_sums". Error in Test5 (line 3) assert(isequal(columnwise_logical_sums(A, L), S_correct))