Cody

Solution 1241874

Submitted on 29 Jul 2017 by Chris Cleveland
  • Size: 9
  • This is the leading solution.
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))

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.]

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

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.]

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

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.]

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

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.]

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

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.]

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

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.]

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

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.]

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

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.]

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

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.]

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

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.]

Suggested Problems

More from this Author161