Main Content

Simulink.fmuexport.ExportSimulinkProjectToFMU

Export project as Functional Mockup Unit (FMU)

Description

Simulink.fmuexport.ExportSimulinkProjectToFMU(project,model,Name,Value) exports a project as a Functional Mockup Unit (FMU) and sets the model as the main interface model.

example

Examples

collapse all

If the Simulink® model EngineGasDynamics.slx exists in the project root/models/ folder, use the following command to export the FMU from project root:

project = slproject.getCurrentProject;...
Simulink.fmuexport.ExportSimulinkProjectToFMU(project,'models/EngineGasDynamics.slx',...
                              '-fmuname',fullfile(project.RootFolder,'EngineGasDynamics.fmu'),...
                              '-fmuicon',fullfile(project.RootFolder,'Simulink_Logo.png'))

Input Arguments

collapse all

Project to export, specified as a string.

Data Types: string

Model that defines the main interface, specified as a string.

Data Types: string

Name-Value Arguments

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

Example: '-fmuname','myFMU'

If not specified, FMU is saved to current directory folder with the same name as the main model.

Data Types: string

The information is saved in modelDescription.xml inside FMU.

Data Types: string

The information is saved in modelDescription.xml inside FMU.

Data Types: string

The information is saved in modelDescription.xml inside FMU.

Data Types: string

The information is saved in modelDescription.xml inside FMU.

Data Types: string

The icon file must be in PNG format. If not specified, generated FMU has no icon file.

Data Types: string

Version History

Introduced in R2018b