customize an application
you can customize an application in several ways: customize the installer, manage files in the project, or add a custom installer path using the application compiler app or the library compiler app.
customize the installer
change application icon
to change the default icon, click the graphic to the left of the library name or application name field to preview the icon.
click select icon, and locate the graphic file to use as the application icon. select the use mask option to fill any blank spaces around the icon with white or the use border option to add a border around the icon.
to return to the main window, click save and use.
add library or application information
you can provide further information about your application as follows:
library/application name: the name of the installed matlab® artifacts. for example, if the name is
foo
, the installed executable isfoo.exe
, and the windows® start menu entry is foo. the folder created for the application is
.installroot
/foothe default value is the name of the first function listed in the main file(s) field of the app.
version: the default value is 1.0.
author name: name of the developer.
support email address: email address to use for contact information.
company name: the full installation path for the installed matlab artifacts. for example, if the company name is
bar
, the full installation path would be
.installroot
/bar/applicationname
summary: brief summary describing the application.
description: detailed explanation about the application.
all information is optional and, unless otherwise stated, is only displayed on the first page of the installer. on windows systems, this information is also displayed in the windows add/remove programs control panel.
change the splash screen
the installer splash screen displays after the installer has started. it is displayed along with a status bar while the installer initializes.
you can change the default image by clicking the select custom splash screen. when the file explorer opens, locate and select a new image.
you can drag and drop a custom image onto the default splash screen.
change the installation path
this table lists the default path the installer uses when installing the packaged binaries onto a target system.
windows | c:\program
files\ |
mac os x | /applications/ |
linux® | /usr/ |
you can change the default installation path by editing the default installation folder field under additional installer options.
a text field specifying the path appended to the root folder is your installation folder. you can pick the root folder for the application installation folder. this table lists the optional custom root folders for each platform:
windows | c:\users\ |
linux | /usr/local |
change the logo
the logo displays after the installer has started. it is displayed on the right side of the installer.
you change the default image in additional installer options by clicking select custom logo. when the file explorer opens, locate and select a new image. you can drag and drop a custom image onto the default logo.
edit the installation notes
installation notes are displayed once the installer has successfully installed the packaged files on the target system. you can provide useful information concerning any additional setup that is required to use the installed binaries and instructions for how to run the application.
determine data type of command-line input (for packaging standalone applications only)
when an executable standalone application is run in the command prompt, the default
input type is char
. you can keep this default, or choose to interpret
all inputs as numeric matlab doubles.
to pass inputs to the standalone application as matlab character vectors, select treat all inputs to the app as
matlab character vectors. in this case, you must include code to
convert char
to a numeric matlab type in the matlab function
to be deployed as a standalone application.
to pass inputs to the standalone application as numeric matlab variables, select treat all inputs to the app as numeric matlab
doubles. option in the application compiler app. thus, you do not need to
include code to convert char
to a numeric matlab type. non numeric inputs to the application may result in an error.
manage required files in compiler project
the compiler uses a dependency analysis function to automatically determine what additional matlab files are required for the application to package and run. these files are automatically packaged into the generated binary. the compiler does not generate any wrapper code that allows direct access to the functions defined by the required files.
if you are using one of the compiler apps, the required files discovered by the dependency analysis function are listed in the files required for your application to run or files required for your library to run field.
to add files, click the plus button in the field, and select the file from the file explorer. to remove files, select the files, and press the delete key.
caution
removing files from the list of required files may cause your application to not package or not to run properly when deployed.
using mcc
if you are using mcc
to package your matlab code, the compiler does not display a list of required files before
running. instead, it packages all the required files that are discovered by the
dependency analysis function and adds them to the generated binary file.
you can add files to the list by passing one or more -a
arguments to mcc
. the -a
arguments add the
specified files to the list of files to be added into the generated binary. for
example, -a hello.m
adds the file hello.m
to
the list of required files and -a ./foo
adds all the files in
foo
and its subfolders to the list of required files.
sample driver file creation
sample driver files are used to implement the generated component into an application in the target language.
the following target types support sample driver file creation in matlab compiler sdk™:
c shared library
java® package
.net assembly
python® package
the sample file creation feature in library compiler uses
matlab code to generate sample files in the target language. in the app, click
create new sample to automatically generate a new matlab script, or click add existing sample to upload a
matlab script that you have already written. after you package your functions, a
sample file in the target language is generated from your matlab script and is saved in a folder named samples
. sample
files are also included in the installer.
to automatically generate a new matlab file, click create new sample. this opens up a matlab file for you to edit. the sample file serves as a starting point, and you should edit it as necessary based on the behavior of your exported functions.
the sample matlab files must follow these guidelines:
the sample file must be a matlab script, not a function.
the sample file code must use only exported functions. any user-defined function called in the script must be a top-level exported function.
each exported function must be in a separate sample file.
each call to the same exported function must be a separate sample file.
the input parameters of the top-level function are analyzed during the process. an input parameter cannot be a field in a struct.
the output of the exported function must be an n-dimensional numeric, char, logical, struct, or cell array.
data must be saved as a local variable and then passed to the exported function in the sample file code.
sample file code should not require user interaction.
the sample script is executed as part of the process of generating the target language sample code. any errors in execution (for instance, undefined variables) will prevent a sample from being generated, although the build target will still be generated.
additional considerations specific to the target language are as follows:
c mwarray api —
varargin
andvarargout
are not supported..net — type-safe api is not supported.
python — cell arrays and char arrays must be of size 1xn and struct arrays must be scalar. there are no restrictions on numeric or logical arrays, other than that they must be rectangular, as in matlab.
to upload a matlab file that you have already written, click add existing sample. the matlab code should demonstrate how to execute the exported functions. the required matlab code can be only a few lines:
input1 = [1 4 7; 2 5 8; 3 6 9]; input2 = [1 4 7; 2 5 8; 3 6 9]; addoutput = addmatrix(input1,input2);
if you have already created a matlab sample file, you can include it in a compiler.build
function for the supported targets using the 'samplegenerationfiles'
option.
you can also choose not to include a sample file at all during the packaging step. if you create your own code in the target language, you can later copy and paste it into the appropriate directory once the matlab functions are packaged.
specify files to install with application
the compiler packages files to install along with the ones it generates. by default,
the installer includes a readme
file with instructions on installing
the matlab runtime and configuring it.
these files are listed in the files installed for your end user section of the app.
to add files to the list, click , and select the file from the file explorer.
jar files are added to the application class path as if you had called .
caution
removing the binary targets from the list results in an installer that does not install the intended functionality.
when installed on a target computer, the files listed in the files installed
for your end user are saved in the application
folder.
additional runtime settings
type of packaged application | additional runtime settings options |
---|---|
standalone applications |
|
excel add-ins |
|