Main Content

Package Apps From theMATLABToolstrip

You can package any MATLAB®app you create into a single file that can be easily shared with others. When you package an app, 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.prjfile continuously. A.prjfile contains information about your app, such as included files and a description. Therefore, if you exit the dialog box before clicking thePackagebutton, the.prj文件仍然,尽管.mlappinstallfile is not created. The.prjfile 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, on theHometab, click theAdd-Onsdown-arrow.

  2. ClickPackage App.

  3. In the Package App dialog box, clickAdd main fileand 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 if there are other files used in the app. For more information, seeApp Packaging Dependency Analysis.

    Tip

    主文件必须返回你的图处理r app for MATLAB to remove your app files from the search path when users exit the app. For more information, seeWhat Is the MATLAB Search Path?

    (Functions created by GUIDE return the figure handle.)

  4. If your app requires additional files that are not listed underFiles included through analysis, add them by clickingAdd files/folders.

    You can include external interfaces, such as MEX-files or Java®in the.mlappinstallfile, although doing so can restrict the systems on which your app can run.

  5. Describe your app.

    1. In theApp Namefield, type an app name.

      If you install the app, MATLAB uses the name for the.mlappinstallfile and to label your app in the apps gallery.

    2. Optionally, specify an app icon.

      Click the icon to the left of theApp Namefield to select an icon for your app or to specify a custom icon. MATLAB automatically scales the icon for use in the Install dialog box, App gallery, and quick access toolbar.

    3. Optionally, select a previously saved screenshot to represent your app.

    4. Optionally, specify author information.

    5. In theDescriptionfield, describe your app so others can decide if they want to install it.

    6. Identify the products on which your app depends.

      Click the plus button on the right side of thes manbetx 845field, select the products on which your app depends, and then clickApply Changes. Keep in mind that your users must have all of the dependent products installed on their systems.

    After you create the package, when you select a.mlappinstallfile in the Current Folder browser, MATLAB displays the information you provided (except your email address and company name) in the Current Folder browserDetailspanel. If you share your app in the MATLAB Central File Exchange, the same information also displays there. The screenshot you select, if any, represents your app in File Exchange.

  6. ClickPackage.

    As part of the app packaging process, MATLAB creates a.prjfile that contains information about your app, such as included files and a description. The.prjfile enables you to update the files in your app without requiring you to respecify descriptive information about the app.

  7. In the Build dialog box, note the location of the installation file (.mlappinstall), and then click克罗se.

For information on installing the app, seeInstall Add-Ons from File.

Related Topics