This solution is outdated. To rescore this solution, sign in.
Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
x= [1 2 ; 2 3 ; 3 4 ; 4 5];
y_correct=[1 2 3 4 5];
assert(isequal(assemble_this(x),y_correct)||isequal(assemble_this(x),fliplr(y_correct)))
ind =
1 2
ind =
1 2
ind =
1 2 3
ind =
1 2 3
ind =
1 2 3 4
ind =
1 2 3 4
|
2 | Pass |
x= [1 1 2 3 ; 4 5 6 7 ; 5 4 8 3];
y_correct=[1 1 2 3 8 4 5 6 7];
assert(isequal(assemble_this(x),y_correct)||isequal(assemble_this(x),fliplr(y_correct)))
ind =
1
ind =
1 3
ind =
1 3
ind =
1 3 2
ind =
1 3 2
|
3 | Pass |
x=[2 3 ; 4 2 ; 3 1 ; 1 5 ; 5 9]
y_correct=[9 5 1 3 2 4];
assert(isequal(assemble_this(x),y_correct)||isequal(assemble_this(x),fliplr(y_correct)))
x =
2 3
4 2
3 1
1 5
5 9
ind =
1 2
ind =
1 2
ind =
1 2 3
ind =
1 2 3
ind =
1 2 3 4
ind =
1 2 3 4
ind =
1 2 3 4 5
ind =
1 2 3 4 5
ind =
1 2
ind =
1 2
ind =
1 2 3
ind =
1 2 3
ind =
1 2 3 4
ind =
1 2 3 4
ind =
1 2 3 4 5
ind =
1 2 3 4 5
|
4 | Pass |
x=[10:-1:6 ; 1:5 ; 5:0.25:6];
y_correct=[1:4 5:0.25:6 7:10]
assert(isequal(assemble_this(x),y_correct)||isequal(assemble_this(x),fliplr(y_correct)))
y_correct =
1.0000 2.0000 3.0000 4.0000 5.0000 5.2500 5.5000 5.7500 6.0000 7.0000 8.0000 9.0000 10.0000
ind =
1
ind =
1 3
ind =
1 3
ind =
1 3 2
ind =
1 3 2
ind =
1
ind =
1 3
ind =
1 3
ind =
1 3 2
ind =
1 3 2
|
5 | Pass |
x=[8 16 24 ; 2 4 8 ; 6 4 2];
y_correct=[6 4 2 4 8 16 24];
assert(isequal(assemble_this(x),y_correct)||isequal(assemble_this(x),fliplr(y_correct)))
ind =
1 2
ind =
1 2
ind =
1 2 3
ind =
1 2 3
ind =
1 2
ind =
1 2
ind =
1 2 3
ind =
1 2 3
|
2486 Solvers
Find common elements in matrix rows
1231 Solvers
482 Solvers
277 Solvers
432 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!