Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
%%
x = [1:4];
y_correct = [1 0 0 0; 0 2 0 0; 0 0 3 0; 0 0 0 4];
assert(isequal(diag_array(x),y_correct))
|
2 | Pass |
%%
x = [100 23 3.14 12 200];
y_correct = [100.0000 0 0 0 0;
0 23.0000 0 0 0;
0 0 3.1400 0 0;
0 0 0 12.0000 0;
0 0 0 0 200.0000]
assert(isequal(diag_array(x),y_correct))
y_correct =
Columns 1 through 2
100 0
0 23
0 0
0 0
0 0
Columns 3 through 4
0 0
0 0
3.14 0
0 12
0 0
Column 5
0
0
0
0
200
|
850 Solvers
What is the next step in Conway's Life?
423 Solvers
Getting the absolute index from a matrix
178 Solvers
166 Solvers
194 Solvers