Cody

Solution 1826189

Submitted on 26 May 2019 by David Hill
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
M = 1:10; M_corr = [2,4,6,4,10,6,14,8,9,10]; assert(isequal(de_primed(M),M_corr))

2   Pass
M = 20:3:50; M_corr = [20,46,26,58,32,35,38,82,44,94,50]; assert(isequal(de_primed(M),M_corr))

3   Pass
M = 2:2:100; M_corr = [4 M(2:end)]; assert(isequal(de_primed(M),M_corr))

4   Pass
M = 10:10:100; M_corr = M; assert(isequal(de_primed(M),M_corr))

5   Pass
M = 3:3:100; M_corr = [6,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57,60,63,66,69,72,75,78,81,84,87,90,93,96,99]; assert(isequal(de_primed(M),M_corr))

6   Pass
M = eye(4); M_corr = 2*M; assert(isequal(de_primed(M),M_corr))

7   Pass
M = magic(6); M_corr = [35, 2, 6,26,38,24; 6,32,14,21,46,25; 62, 9, 4,22,27,20; 8,28,33,34,10,15; 30,10,34,12,14,16; 4,36,58,26,18,22]; assert(isequal(de_primed(M),M_corr))

8   Pass
ind = randi(4); switch ind case 1 M = 1:10; M_corr = [2,4,6,4,10,6,14,8,9,10]; case 2 M = eye(4); M_corr = 2*M; case 3 M = 10:10:100; M_corr = M; case 4 M = magic(6); M_corr = [35, 2, 6,26,38,24; 6,32,14,21,46,25; 62, 9, 4,22,27,20; 8,28,33,34,10,15; 30,10,34,12,14,16; 4,36,58,26,18,22]; end assert(isequal(de_primed(M),M_corr))

9   Pass
ind = randi(4); switch ind case 1 M = 3:3:100; M_corr = [6,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57,60,63,66,69,72,75,78,81,84,87,90,93,96,99]; case 2 M = 1:10; M_corr = [2,4,6,4,10,6,14,8,9,10]; case 3 M = eye(4); M_corr = 2*M; case 4 M = 20:3:50; M_corr = [20,46,26,58,32,35,38,82,44,94,50]; end assert(isequal(de_primed(M),M_corr))

10   Pass
ind = randi(4); switch ind case 1 M = 20:3:50; M_corr = [20,46,26,58,32,35,38,82,44,94,50]; case 2 M = 10:10:100; M_corr = M; case 3 M = 2:2:100; M_corr = [4 M(2:end)]; case 4 M = 1:10; M_corr = [2,4,6,4,10,6,14,8,9,10]; end assert(isequal(de_primed(M),M_corr))