MATLAB: How to export Simulink model to Functional Mockup Unit (FMU) for use in other modeling tools

cosimulationexportfmusimulink

I need to export part of a Simulink model in a way that I can integrate it into an existing Dymola model. Is it possible to create a FMU from the Simulink model?

Best Answer

Beginning with R2020a, you can export your Simulink model as a standalone FMU with Simulink Compiler . When a third-party tool runs the FMU, no MATLAB or Simulink license will be required. 
Beginning with R2019a, the ability to export a Simulink model to a tool-coupling FMU is available in Simulink:
Wrap your Simulink model and project files into an FMU that has a co-simulation interface. When a third-party tool runs the FMU, the FMU checks out the required MathWorks® licenses, starts a local MATLAB® session, and runs the model.
In R2018b, a MathWorks®-provided support package: "Tool-Coupling Co-Simulation FMU Export for Simulink support package" is required
While we recommend this to be downloaded through the Add-On Explorer, a link to open it in Add-On Explorer is available on File Exchange:
For R2018a and prior, there are third-party products which may provide this functionality. Please refer to the following links for more information: