magic (MathScript RT Module Function)

LabVIEW 2012 MathScript RT模块帮助

版本日期:June 2012

产品编号:373123C-0118

»查看产品信息
下载帮助
(仅限Windows)

Owning Class: matrix

Requires: MathScript RT Module

Syntax

c = magic(a)

Description

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.

Examples

Inputs

Name Description
a Specifies the size of the magic square. a is an integer greater than 2.

Outputs

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

Details

The following table lists the support characteristics of this function.

Supported in the LabVIEW Run-Time Engine Yes
Supported on RT targets Yes
Suitable for bounded execution times on RT Not characterized

Examples

A = magic(10)

文章是否对您有帮助?

没有帮助