Main Content

exportToFMU2CS

Export Simulink model to Functional Mock-up Unit (FMU)

Description

example

exportToFMU2CS(mdl) exports a model to a Functional Mock-Up Unit (FMU) and creates a model, mdl_fmu.slx, that contains a FMU Co-Simulation block with the original model. Model solver type must be a fixed-step solver.

exportToFMU2CS(mdl,Name,Value) exports a model to a Functional Mock-Up Unit (FMU) using one or more Name, Value pair arugments.

Examples

collapse all

Export the model, vdp to a Functional Mock-Up Unit.

Open the model.

open_system('vdp')

Set the solver type of the model to fixed-step.

set_param('vdp', 'SolverType', 'Fixed-step')

Export the model to a FMU. The model, vdp_fmu.slx is created from the exported FMU.

exportToFMU2CS('vdp')

Input Arguments

collapse all

Name of the model to be exported to a Functional Mock-Up Unit

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside quotes. You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

Example: 'CreateModelAfterGeneratingFMU','off'

By deafult, creates a model, mdl_fmu.slx, that contains a FMU Co-Simulation block with the original model. Create this model to check the integrity of the exported FMU.

When set to 'off', does not create a model.

Block icon image, character vector specified as one of the following values:

  • 'off' – No block icon image

  • 'snapshot' – Use image of model as block icon

  • 'filename' – An image file to be used as a block icon.

Set the option to 'on' to support exporting Co-simulations of FMUs with 32-bit binaries.

Example:

Introduced in R2020a