Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
x = 1;
y_correct = 1;
assert(isequal(getArrayWithDiagOnes(x),y_correct))
ans =
[]
|
2 | Pass |
x = 2;
y_correct = [1,1;1,1];
assert(isequal(getArrayWithDiagOnes(x),y_correct))
ans =
[]
|
3 | Pass |
x = 5;
y_correct = [1 0 0 0 1;0 1 0 1 0;0 0 1 0 0;0 1 0 1 0;1 0 0 0 1];
assert(isequal(getArrayWithDiagOnes(x),y_correct))
ans =
[]
|
Is my wife right? Now with even more wrong husband
1241 Solvers
Omit columns averages from a matrix
527 Solvers
Back to basics 23 - Triangular matrix
634 Solvers
173 Solvers
525 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!