Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
filetext = fileread('pop.m');
assert(isempty(strfind(filetext, 'regexp')),'regexp hacks are forbidden')
|
2 | Pass |
v = [1, 2, 7];
n = 0;
[v, w] = pop(v, n);
v_correct = [1, 2, 7];
assert(isequal(v, v_correct));
assert(isempty(w));
[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.]
[> In unix (line 32)
In pop (line 2)
In ScoringEngineTestPoint2 (line 3)
In solutionTest (line 5)]
|
3 | Pass |
v = 1:10;
n = 3;
[v, w] = pop(v, n);
v_correct = 1:7;
w_correct = 8:10;
assert(isequal(v, v_correct));
assert(isequal(w, w_correct));
[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.]
[> In unix (line 32)
In pop (line 2)
In ScoringEngineTestPoint3 (line 3)
In solutionTest (line 7)]
|
4 | Pass |
v = [1; 2; 3]
n = 5;
[v, w] = pop(v, n);
w_correct = [1; 2; 3];
assert(isempty(v));
assert(isequal(w, w_correct));
v =
1
2
3
[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.]
[> In unix (line 32)
In pop (line 2)
In ScoringEngineTestPoint4 (line 3)
In solutionTest (line 9)]
|
5 | Pass |
v = ones(10, 1);
n = 4;
[v, w] = pop(v, n);
v_correct = ones(6, 1);
w_correct = ones(4, 1);
assert(isequal(v, v_correct));
assert(isequal(w, w_correct));
[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.]
[> In unix (line 32)
In pop (line 2)
In ScoringEngineTestPoint5 (line 3)
In solutionTest (line 11)]
|
6 | Pass |
v = zeros(1, 8);
n = 2;
[v, w] = pop(v, n);
v_correct = zeros(1, 6);
w_correct = zeros(1, 2);
assert(isequal(v, v_correct));
assert(isequal(w, w_correct));
[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.]
[> In unix (line 32)
In pop (line 2)
In ScoringEngineTestPoint6 (line 3)
In solutionTest (line 13)]
|
Given an unsigned integer x, find the largest y by rearranging the bits in x
780 Solvers
ベクトル [1 2 3 4 5 6 7 8 9 10] の作成
292 Solvers
What is Sum Of all elements of Matrix
292 Solvers
121 Solvers
137 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!