Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
dVar = [1:5 4:-1:1];
ref = diag(dVar);
user = MatrixFunc();
assert(isequal(user,ref))
ans =
1 0 0 0 0 0 0 0 0
0 2 0 0 0 0 0 0 0
0 0 3 0 0 0 0 0 0
0 0 0 4 0 0 0 0 0
0 0 0 0 5 0 0 0 0
0 0 0 0 0 4 0 0 0
0 0 0 0 0 0 3 0 0
0 0 0 0 0 0 0 2 0
0 0 0 0 0 0 0 0 1
|
519 Solvers
Omit columns averages from a matrix
527 Solvers
Program an exclusive OR operation with logical operators
639 Solvers
Back to basics 13 - Input variables
233 Solvers
242 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!