Main Content

shareMATLABForFMUCoSim

Share current MATLAB session for FMU tool-coupling co-simulation

    Description

    shareMATLABForFMUCoSim dedicates the current MATLAB® session available for requests from the external tool to co-simulate an imported FMU. When an FMU is connected to this session, the Simulink® editor and Simulink project are loaded, and co-simulation starts automatically. You can use this session to pause, resume co-simulation, tune parameters, and plot signals from the command window while co-simulation is running. If co-simulation is finished, stopped by you, or interrupted by a runtime error, MATLAB closes, unloads the Simulink editor and Simulink project, and discards changes to the model. If an error occurs, it displays in the simulation tool that imports this FMU. Each session can connect to one FMU instance at the same time.

    example

    Examples

    collapse all

    Dedicate the current MATLAB session for requests from external tools to co-simulate an imported FMU.

    shareMATLABForFMUCoSim
    The current MATLAB session ('MATLAB_27284') is now dedicated 
    for tool-coupling co-simulation FMU usage. Make sure your work 
    is saved, and no other application is connecting to this MATLAB session.

    Version History

    Introduced in R2019a