Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
x = 5;
y_correct = [0 0 0 0 0;0 1 0 0 0; 0 0 1 0 0; 0 0 0 1 0;0 0 0 0 0];
assert(isequal(eye_first_last(x),y_correct))
y =
0 0 0 0 0
0 1 0 0 0
0 0 1 0 0
0 0 0 1 0
0 0 0 0 1
y =
0 0 0 0 0
0 1 0 0 0
0 0 1 0 0
0 0 0 1 0
0 0 0 0 0
|
2 | Pass |
x = 2;
y_correct = [0 0;0 0];
assert(isequal(eye_first_last(x),y_correct))
y =
0 0
0 1
y =
0 0
0 0
|
3 | Pass |
x=1;
y_correct = [0];
assert(isequal(eye_first_last(x),y_correct))
y =
0
y =
0
|
4 | Pass |
x=3;
y_correct = [0 0 0;0 1 0;0 0 0];
assert(isequal(eye_first_last(x),y_correct))
y =
0 0 0
0 1 0
0 0 1
y =
0 0 0
0 1 0
0 0 0
|
Determine whether a vector is monotonically increasing
11925 Solvers
3076 Solvers
1051 Solvers
579 Solvers
276 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!