Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
%%
x = magic(4);
y_correct = sum(diag(x));
assert(isequal(your_fcn_name(x),y_correct))
ans =
34
|
2 | Pass |
%%
x = ones(5);
y_correct = sum(diag(x));
assert(isequal(your_fcn_name(x),y_correct))
ans =
5
|
199 Solvers
Getting the absolute index from a matrix
211 Solvers
Sum the numbers on the main diagonal
453 Solvers
Find the index of the largest value in any vector X=[4,3,4,5,9,12,0,4.....5]
298 Solvers
264 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!