exportToFMU2CS
Description
exportToFMU2CS(
exports mdl
)mdl
to
mdl.fmu
. The model solver type must be
fixed-step
solver.
exportToFMU2CS(
exports a model to a Functional Mock-Up Unit (FMU) using one or more mdl
,Name,Value
)Name,
Value
pair arguments.
Examples
Export a Model to FMU
Export the model vdp
to an FMU.
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 vdp.fmu
exportToFMU2CS('vdp')
Input Arguments
mdl
— Name of model
string
Name of the model to be exported to an FMU, specified as a 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: 'CreateModelAfterGeneratingFMU','off'
CreateModelAfterGeneratingFMU
— Option to create model after export
'off'
(default) | 'on'
Option to create model after export, specified as 'on'
or
'off'
. This argument creates a model,
mdl_fmu.slx
, that contains an FMU Co-Simulation block with the
original model. Create this model to check the integrity of the exported FMU.
When set to 'off'
, no model is created.
AddIcon
— Block icon or exported FMU image
'snapshot'
(default) | 'off'
| 'filepath'
Block icon or exported FMU image, character vector specified as one of these values:
'off'
– No block icon image.'snapshot'
– Use image of model as block icon.'filepath'
– Filepath of the image.
Generate32BitDLL
— Option to generate 32-bit DLL
'off'
(default) | 'on'
Option to generate 32-bit DLL, specified as 'on'
or
'off'
. Set the option to 'on'
to support
exporting Co-simulations of FMUs with 32-bit binaries. Only valid on
win64
platform with MSVC toolchain installed.
SaveSourceCodeToFMU
— Option to save source code to FMU
'off'
(default) | 'on'
Option to save source code to FMU, specified as 'on'
or
'off'
. Set to 'on'
to package the source code
in the source directory and documentation file, which recompiles the binary files in
the documentation directory in the FMU. This option requires Simulink®
Coder™.
SaveDirectory
— Specify save location for FMU
string | character vector
Save location for FMU, specified as a string or character vector. By default, the location is the current working folder.
Example: exportToFMU2CS(model,'SavedDirectory','/tmp/flightcontrol/')
ExportedContent
— Option to create a wrapper archived project or harness model with dependencies
'off'
(default) | 'project'
Option to create to create a wrapper-archived project or harness model with
dependencies, specified as 'off'
or 'project'
.
Set to 'project'
to enable this option.
ProjectName
— Name of archived project
string
Name of archived project with harness model, specified as a string. This argument
must be specified along with the 'ExportContent'
argument. By
default, archived project is named modelName_fmu
Package
— Destination folder and the files to be packaged
cell array
Destination folder and files to be packaged, specified as a cell array.
Example: exportToFMU2CS(model, 'Package', {'documentation/',
{'/local/bouncingBall/index.html','/local/bouncingBall/siteFiles'},...
'resources',{'local/bouncingBall/resources/input.txt'}})
Version History
Introduced in R2020a
MATLAB-Befehl
Sie haben auf einen Link geklickt, der diesem MATLAB-Befehl entspricht:
Führen Sie den Befehl durch Eingabe in das MATLAB-Befehlsfenster aus. Webbrowser unterstützen keine MATLAB-Befehle.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)