magic
- :
M =magic(n)¶ Return the n-by-n magic square: each of the integers 1 to
n^2occurs once and all row sums, column sums and the two main diagonal sums are equal.The result has class single for single input, the input’s class for integer input and double otherwise.