User`s guide
3 Usage Examples
Magic Square Examples
The M-file mymagic takes a single input, an integer, and creates a magic
square of that size.
The Excel file
mymagic.xls uses this function in three different ways:
• The first illustration calls the function
mymagic with a value of 4. The
function returns a magic square of size 4 and populates a range of Excel
cells with that magic square.
• The sec ond illustrat ion uses the transpose flag to transpose a magic square
of size 4.
• The third illustration resizes the output to a higher value and moves its
location within the E xcel worksheet.
Note To get started, copy the distributed directory xlmagic from
matlabroot\toolbox\matlabxl\examples\xlmagic to matlabroot\work.
Creating the Project
1 From the MATLAB command prompt, change directories to
matlabroot\work.
2 If you have not
already done so, execute the following command in
MATLAB:
mbuild -setup
Be sure to choo
se a supported compiler. S e e Supported Compilers at
http://www.
mathworks.com/support/tech-notes/1600/1601.shtml
.
3 Enter the deploytool command to open the Deployment Tool.
4 Create a project with the following settings.
3-2