From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
To download NI software, including the products shown below, visit ni.com/downloads.
1. Overview
This example generates the magic square of any given order (or size).
2. Description
A magic square is a square array of numbers consisting of the distinct positiveintegers 1, 2, ..., n^2 arranged
such that the sum of the n numbers in anyhorizontal, vertical, or main diagonal line is always the same number.
The Main VI is a program that generates the magic squares of all dimensions. To generate these magic squares, we
develop the three more important methods to generate them. This example shows how to manipulate arrays and how to
switch subVI's based on givenconditions. The three methods togenerate a magic square are:
- De La Loubère's Method.- generates magic squares of odd order, for example: 3, 5, 7, 9, 11…
- X Method.- generates magicsquares of 4*m order, for example: 4, 8, 12, 16, 20…
- LUX Method.- generates magicsquares of order not divisible to 4, for example: 6, 10, 14, 18, 22…
3. Requirements
4. Steps to Implement or Execute Code
5. Additional Information or References
**The code for this example has been edited to meet the new Community Example Style Guidelines.**
Description-Separate-2Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.
I present them my gallery of snapshots of applications developed in
LabVIEW.
I thank to some members of LabVIEW-user groups for their contributions with regard to the design of GUIs.
LabVIEW GUI Gallery Link: http://forums.lavag.org/gallery-user8339-album77.html
I love Magic Square. I cant wait to see these application. Hope we can create application for the Largest Magic square. I have created variety of magic square using magic square of order 4p and created 6000 by 6000 magic square on a spreedsheet.