Cody

# Problem 42317. De-primed

Solution 1241864

Submitted on 29 Jul 2017
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
M = 1:10; M_corr = [2,4,6,4,10,6,14,8,9,10]; assert(isequal(de_primed(M),M_corr))

Assertion failed.

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   Fail
M = eye(4); M_corr = 2*M; assert(isequal(de_primed(M),M_corr))

Assertion failed.

7   Fail
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))

Assertion failed.

8   Fail
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))

Assertion failed.

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))

### Community Treasure Hunt

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

Start Hunting!