Arrange integers from 1 to n^2 into an n-by-n matrix using the following pattern (shown is the case where n is equal to 6):
Given n please find the sum of the terms in the diagonal of this matrix (i.e., the sum of the numbers in the green cells).
Solution Stats
Problem Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers27
Suggested Problems
-
Find all elements less than 0 or greater than 10 and replace them with NaN
15783 Solvers
-
The Hitchhiker's Guide to MATLAB
3408 Solvers
-
"Low : High - Low : High - Turn around " -- Create a subindices vector
583 Solvers
-
824 Solvers
-
Create matrix of replicated elements
397 Solvers
More from this Author180
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!