Cody

Problem 2692. design a magic matrix without using the command magic.

Solution 2113291

Submitted on 1 Feb 2020
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Fail
x = 4; y_correct = [16 3 2 13;5 10 11 8;9 6 7 12;4 15 14 1] assert(isequal(magic_mat(x),y_correct))

y_correct = 16 3 2 13 5 10 11 8 9 6 7 12 4 15 14 1

Assertion failed.

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!