Main Content

compiler.build.Results

Compiler build results object

Description

A compiler.build.Results object contains the build type, files, and build options of a compiler.build function.

All Results properties are read-only. You can use dot notation to query these properties.

Creation

There are several ways to create a compiler.build.Results object.

Properties

expand all

This property is read-only.

The name of the compiler.build function used to generate the results, specified as one of these character vectors:

Example: 'productionServerArchive'

Data Types: char

This property is read-only.

Paths to the compiled build files of the associated compiler.build function, specified as a cell array of character vectors.

Build TypeFiles
standaloneApplication

2×1 cell array

    {'path\to\ExecutableName.exe'}    
    {'path\to\readme.txt'}
standaloneWindowsApplication

3×1 cell array

    {'path\to\ExecutableName.exe'}
    {'path\to\splash.png'}
    {'path\to\readme.txt'}
webAppArchive

1×1 cell array

    {'path\to\ArchiveName.ctf'}
productionServerArchive

1×1 cell array

    {'path\to\ArchiveName.ctf'}

Example: {'D:\Documents\MATLAB\work\MagicSquarewebAppArchive\MagicSquare.ctf'}

Data Types: cell

This property is read-only.

Build options from the associated compiler.build function, specified as an options object of the corresponding build type.

Build TypeOptions
standaloneApplicationStandaloneApplicationOptions
standaloneWindowsApplicationStandaloneApplicationOptions
webAppArchiveWebAppArchiveOptions
productionServerArchiveProductionServerArchiveOptions (MATLAB Compiler SDK)

Examples

collapse all

Create a standalone application and save information about the build type, included files, and build options to a compiler.build.Results object.

Save the compiler.build.standaloneApplication information to a Results object by declaring an output variable.

results = compiler.build.standaloneApplication('mymagic.m')
results = 

  Results with properties:

            BuildType: 'standaloneApplication'
                Files: {2×1 cell}
              Options: [1×1 compiler.build.StandaloneApplicationOptions]

The Files property contains the paths to the generated standalone executable and readme files.

Create a standalone Windows application and save information about the build type, included files, and build options to a compiler.build.Results object on a Windows system.

Save the compiler.build.standaloneWindowsApplication information to a Results object by declaring an output variable.

results = compiler.build.standaloneWindowsApplication('mymagic.m','AdditionalFiles',["myvars.mat","mysubfunction.m"])
results = 

  Results with properties:

            BuildType: 'standaloneWindowsApplication'
                Files: {3×1 cell}
              Options: [1×1 compiler.build.StandaloneApplicationOptions]

The Files property contains the paths to the generated standalone executable, splash image, and readme files.

Create a web app archive and save the build type, path to the archive file, and build options to a compiler.build.Results object.

Save the compiler.build.webAppArchive information to a Results object by declaring an output variable.

results = compiler.build.webAppArchive('example.mlapp')
results = 

  Results with properties:

    BuildType: 'webAppArchive'
        Files: {'D:\Documents\MATLAB\work\examplewebAppArchive\example.ctf'}
      Options: [1×1 compiler.build.WebAppArchiveOptions]

Create a production server archive and save the build type, path to the archive file, and build options to a compiler.build.Results object.

Save the compiler.build.productionServerArchive information to a Results object by declaring an output variable.

results = compiler.build.productionServerArchive('mymagic.m')
results = 

  Results with properties:

            BuildType: 'productionServerArchive'
                Files: 'D:\Documents\MATLAB\work\mymagicproductionServerArchive\mymagic.ctf'
              Options: [1×1 compiler.build.ProductionServerArchiveOptions]
Introduced in R2020b