MATLAB Creating Graphical User Interfaces

(Barry) #1
Package Apps

Package Apps


Package apps you create into an app package for sharing with others. When you create
an app package, MATLAB creates a single app installation file (.mlappinstall). The
installation file enables you and others to install your app and access it from the apps
gallery without concern for installation details or the MATLAB path.

Note:As you enter information in the Package Apps dialog box, MATLAB creates and
saves a .prj file continuously. A .prj file contains information about your app, such
as included files and a description. Therefore, if you exit the dialog box before clicking
the Package button, the .prj file remains, even though a .mlappinstall file is not
created. The .prj file enables you to quit and resume the app creation process where you
left off.

To create an app installation file:

1 On the desktop Toolstrip, click the Apps tab.
2 In the File section, click Package App.
3 Click Add main file and specify the file that you use to run the app you created.

The main file must be callable with no input, and must be a function or method, not
a script. MATLAB analyzes the main file to determine other MATLAB files on which
the main file depends. For more information, see “Dependency Analysis” on page
16-10.

TipThe main file must return the figure handle of your app for MATLAB to remove
your app files from the search path when users exit the app. For more information,
see “What Is the MATLAB Search Path?”

(Functions created by GUIDE return the figure handle.)
4 Add additional files required to run your app, by clicking Add files/folders.

Such files are data, image, and other files that were not included via dependency
analysis.
Free download pdf