Cody

Solution 2027636

Submitted on 19 Nov 2019 at 14:02 by Jean-Marie Sainthillier
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 = [3 4 5 6 2 4 5 6 3 6]; n = 4; y_correct = [0 0 5 6 0 0 5 6 0 6]; assert(isequal(find_elements(A,n),y_correct))

A = 0 0 5 6 0 0 5 6 0 6

2   Pass
A = [0; 6; 1; 7; 3; 5; 2; 4]; n = 3; y_correct = [0; 6; 0; 7; 0; 5; 0; 4]; assert(isequal(find_elements(A,n),y_correct))

A = 0 6 0 7 0 5 0 4

3   Pass
A = magic(4); n = 8; y_correct = [16 0 0 13; 0 11 10 0; 9 0 0 12; 0 14 15 0]; assert(isequal(find_elements(A,n),y_correct))

A = 16 0 0 13 0 11 10 0 9 0 0 12 0 14 15 0

Suggested Problems

More from this Author1