Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
x=[1 0 0 4;5 0 7 0; 9 0 11 0]
y_correct = [1 0 4;5 7 0; 9 11 0]
assert(isequal(DelCols(x),y_correct))
x =
1 0 0 4
5 0 7 0
9 0 11 0
y_correct =
1 0 4
5 7 0
9 11 0
x =
1 0 4
5 7 0
9 11 0
|
2 | Pass |
x=[1:5;2:6;3:7]
y_correct = [1:5;2:6;3:7]
assert(isequal(DelCols(x),y_correct))
x =
1 2 3 4 5
2 3 4 5 6
3 4 5 6 7
y_correct =
1 2 3 4 5
2 3 4 5 6
3 4 5 6 7
x =
1 2 3 4 5
2 3 4 5 6
3 4 5 6 7
|
3 | Pass |
x=zeros(10)
x(:,3)=7
y_correct =repmat(7,1,10)'
assert(isequal(DelCols(x),y_correct))
x =
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
x =
0 0 7 0 0 0 0 0 0 0
0 0 7 0 0 0 0 0 0 0
0 0 7 0 0 0 0 0 0 0
0 0 7 0 0 0 0 0 0 0
0 0 7 0 0 0 0 0 0 0
0 0 7 0 0 0 0 0 0 0
0 0 7 0 0 0 0 0 0 0
0 0 7 0 0 0 0 0 0 0
0 0 7 0 0 0 0 0 0 0
0 0 7 0 0 0 0 0 0 0
y_correct =
7
7
7
7
7
7
7
7
7
7
x =
7
7
7
7
7
7
7
7
7
7
|
How to find the position of an element in a vector without using the find function
2477 Solvers
Back to basics 8 - Matrix Diagonals
781 Solvers
450 Solvers
156 Solvers
60 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!