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
|
584 Solvers
Generate a vector like 1,2,2,3,3,3,4,4,4,4
3609 Solvers
Count decimal digits of a number
176 Solvers
289 Solvers
664 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!