Cody

Problem 2620. Determine the Anti-diagonal of a Magic Square

Solution 509879

Submitted on 7 Oct 2014 by George Berken
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

This solution is outdated. To rescore this solution, sign in.

Test Suite

Test Status Code Input and Output
1   Pass
%% n = 3; y_correct = [6 5 4]; assert(isequal(other_diag(n),y_correct))

2   Pass
%% n = 4 y_correct = [13 10 7 4]; assert(isequal(other_diag(n),y_correct))

n = 4

3   Pass
%% n = 7; y_correct = [28 27 26 25 24 23 22]; assert(isequal(other_diag(n),y_correct))

Suggested Problems

More from this Author2

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!