User`s guide

Magic Square Examples
Setting
Value
Project name
xlmagic
Class name
xlmagicclass
Project d irectory The name of your work directory followed by the
component name.
Show verbose
output
Selected
5 Locate your w ork directory and navigate to the <matlab>\work\xlmagic
directory and add the mymagic.m file to the project.
6 B uild the component by clicking the B uild button in the Deployment
Tool toolbar.
The b uild process begins, and a log of the build appears in the Output
pane of the Deployment Tool dialog b ox . The files that are needed fo r the
component are copied to two newly created directories,
src and distrib,in
the
xlmagic directory. A copy of the build log is placed in the src directory.
Adding the Excel Builder COM Function to Excel
1 Start Excel
on your system.
2 Open the file <matlab>\work\xlmagic\mymagic.xls.
Note If an Excel prompt says that this file contains macros, click Enable
Macros to run this example.
Illustration 1. Output Magic Square Results to Excel
From the Excel main window (not the Visual Basic Editor), open the Macro
dialog bo x by pressing the Alt an d F8 keys simultaneously, or by selecting
Tools > M acro > Macros.
Select
mymagic from the list and click Run. This procedure returns a magic
square of size 4 beginning in cell B2.
3-3