This is machine translation

Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Translate This Page

MathWorks Machine Translation

The automated translation of this page is provided by a general purpose third party translator tool.

MathWorks does not warrant, and disclaims all liability for, the accuracy, suitability, or fitness for purpose of the translation.

Apps Overview

What Is an App?

A MATLAB® app is a self-contained MATLAB program with
a user interface that automates a task or calculation. All the operations
required to complete the task — getting data into the app,
performing calculations on the data, and getting results are performed
within the app. Apps are included in many MATLAB products. In
addition, you can create your own apps. The Apps tab
on the MATLAB Toolstrip displays all currently installed apps
when you click the down arrow on the far right of the toolstrip.

Note

You cannot run MATLAB apps using the MATLAB Runtime.
Apps are for MATLAB to MATLAB deployment. To run code using
the MATLAB Runtime, the code must be packaged using MATLAB
Compiler™.

Where to Get Apps

There are three key ways to get apps:

MATLAB Products

Many MATLAB products, such as Curve Fitting
Toolbox™, Signal
Processing Toolbox™,
and Control System
Toolbox™ include apps. In the apps gallery, you
can see the apps that come with your installed products.

Create Your Own

You can create your own MATLAB app and package it into
a single file that you can distribute to others. The apps packaging
tool automatically finds and includes all the files needed for your
app. It also identifies any MATLAB products required to run your
app.

You can share your app directly with other users, or share it
with the MATLAB user community by uploading it to the MATLAB File
Exchange. When others install your app, they do not need to be concerned
with the MATLAB search path or other installation details.

Apps (and other files) uploaded to the MATLAB File Exchange
are available from within MATLAB:

On the Home tab, in the Environment section,
click the Add-Ons arrow button.

Click Get Add-Ons.

Search for apps by name or descriptive text.

Why Create an App?

When you create an app package, MATLAB creates a single
app installation file (.mlappinstall) that enables
you and others to install your app easily.

In particular, when you package an app, the app packaging tool:

Performs a dependency analysis that helps you find
and add the files your app requires.

Reminds you to add shared resources and helper files.

Stores information you provide about your app with
the app package. This information includes a description, a list of
additional MATLAB products required by your app, and a list of
supported platforms.

Automates app updates (versioning).

In addition when others install your app:

It is a one-click installation.

Users do not need to manage the MATLAB search
path or other installation details.

Your app appears alongside MATLAB toolbox apps
in the apps gallery.

Best Practices and Requirements for Creating an App

Best practices:

Write the app as an interactive application with a
user interface written in the MATLAB language.

All interaction with the app is through the user interface.

Make the app reusable. Do not make it necessary for
a user restart the app to use different data or inputs with it.

Ensure the main function returns the handle of the
main figure. (The main function created by GUIDE returns the figure
handle by default.)

Although not a requirement, doing so enables MATLAB to
remove the app files from the search path when users exit the app.

If you want to share your app on MATLAB File
Exchange, you must release it under a BSD license. In addition, there
are restrictions on the use of binary files such as MEX-files, p-coded
files, or DLLs.

Requirements:

The main file must be a function (not a script).

Because you invoke apps by clicking an icon in the
apps gallery, the main function cannot have any required input arguments.
However, you can define optional input arguments. One way to define
optional input arguments is by using varargin.