Table Of Contents

magic

Version:
    Last Modified: March 15, 2017

    Generates a magic square. A magic square has equal row, column, and diagonal sums. If you can express the width of the square as an odd number or as a multiple of 4, the magic square is a diabolic or pandiagonal square, whose subdiagonal sums also equal the diagonal sums.

    Syntax

    c = magic(a)

    Inputs

    a

    Size of the magic square. a is an integer greater than 2.

    Outputs

    c

    a-by-a magic square. The elements in c are integers from 1 to a^2. c is a matrix.

    A = magic(10)

    Where This Node Can Run:

    Desktop OS: Windows

    FPGA: This product does not support FPGA devices


    Recently Viewed Topics