Double-click the MATLAB component icon . The MATLAB Component Editor appears.
From the MATLAB Component Editor, click the Contents
tab.
Select the desired mapping-type action from the Initialize,
Execution Order, or Finalize subtabs.
An area for defining the Command appears on the
right side of the editor.
You can edit the name used to identify the Command
action in the Command text box.
Enter commands in the Enter MATLAB commands below or upload
an M-Script file text area on the right side of the editor. You can enter the commands directly in the text area or load the commands from an existing MATLAB M-Script file.
-
Click Open, and locate the file that you want
to load.
-
Determine if you to store the M-Script in the model.
Yes |
The current contents of the
M-Script file are read and stored within the component (i.e., as if the
contents had been typed into the text box). This command can be run no
matter where the component executes. If you edit the M-Script file at
a later time, you must also edit this command if you want it to run the
updated script. |
No |
The MATLAB component creates
an Isight
input file parameter, configured to the absolute path and name of the
M-Script file, and adds it to the component. When the command is run,
the current contents of the M-Script file are returned by that file parameter.
Therefore, this command can be run only if that path is accessible wherever
the component is executed. If you edit the M-Script file at a later time,
the component automatically runs the updated script. |
-
Click Open to load the file and to return to
the MATLAB Component Editor.
If desired, right-click in the Enter MATLAB commands below
or upload an M-Script file text area, and click Scan
for variables to map.
The MATLAB editor scans the script currently displayed in the box for
MATLAB variable names. The MATLAB variable names that appear in the script
are used to create potential Isight
parameters that can be mapped to or from the corresponding MATLAB variables.
If you use this option, you may want to create all your commands before
creating your mappings.
Click OK to save your changes and to close the
MATLAB Component Editor.
|