Determine the anti-diagonal (crossing from top right to lower left) of a magic square of size n.
Examples
If n = 3
y = 6 5 4
If n = 4
y = 13 10 7 4
Solution Stats
Problem Comments
3 Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers115
Suggested Problems
-
Return the 3n+1 sequence for n
8486 Solvers
-
Project Euler: Problem 6, Natural numbers, squares and sums.
2535 Solvers
-
Make a random, non-repeating vector.
11170 Solvers
-
Generate vector according to sign of vector
133 Solvers
-
Decide whether determinant is zero.
109 Solvers
More from this Author1
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
Please change test case. It is giving error.
y_correct=[13 10 7 4];
The brackets and the first test case has no function call.
I fixed the tests.