Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
filetext = fileread('bubbles.m');
assert(isempty(strfind(filetext, 'regexp')),'regexp hacks are forbidden')
|
2 | Pass |
v = [1 3 0 5 0 -1]';
w_correct = [0 0 1 3 5 -1]';
assert(isequal(bubbles(v),w_correct))
z =
0
0
nz =
1
3
5
-1
w =
0
0
1
3
5
-1
|
3 | Pass |
v = [0 0 9 2 6]';
w_correct = v;
assert(isequal(bubbles(v),w_correct))
z =
0
0
nz =
9
2
6
w =
0
0
9
2
6
|
4 | Pass |
v = [1 3 5 -1]';
w_correct = v;
assert(isequal(bubbles(v),w_correct))
z =
0×1 empty double column vector
nz =
1
3
5
-1
w =
1
3
5
-1
|
5 | Pass |
v = [0 1 0 1 1 1 0]';
w_correct = [0 0 0 1 1 1 1]';
assert(isequal(bubbles(v),w_correct))
z =
0
0
0
nz =
1
1
1
1
w =
0
0
0
1
1
1
1
|
272 Solvers
501 Solvers
Back to basics 21 - Matrix replicating
1052 Solvers
579 Solvers
Multiples of a Number in a Given Range
214 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!