M = magic(N)
| Parameter | Description |
|---|---|
| N | Matrix order, specified as a scalar integer. |
| Parameter | Description |
|---|---|
| M | result of magic function. |
M = magic(N) computes an square matrix constructed as an arrangement of the 1:n^2 such that the row sums, column sums, and diagonal sums are all equal to the same value.
M = magic(3)
| Version | Description |
|---|---|
| 1.0.0 | initial version |