Skip to content
This repository was archived by the owner on May 21, 2020. It is now read-only.
Florian Rappl edited this page Dec 21, 2014 · 2 revisions

magic

The magic function randomly generates matrices that consist only of unique entries 1 <= k <= n^2, where n is the dimension of the matrix. The determinant of a magic matrix is always 0.

magic(n)

Creates a magic nxn-matrix, that consists only of integer entries.

Argument n

Scalar

Returns 1. entry

Matrix

Example

magic(3)

Creates a 3x3-matrix with unique shuffled entries ranging from 1 to 9.

Clone this wiki locally