We are all familiar with the concept of magic matrix.
In a magic matrix, the summation of all rows, columns and both diagonals are always the same. It contains unique integers and is in the form of a square matrix.
Matlab provides a built-in function to create a magic square. In this question, you have to write a code to do it yourself - the magic function is forbidden.

Solution Stats

23 Solutions

10 Solvers

Last Solution submitted on Jul 22, 2026

Last 200 Solutions

Solution Comments

Show comments
Loading...

Problem Recent Solvers10

Suggested Problems

More from this Author174

Community Treasure Hunt

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

Start Hunting!