How to automatically to load an FMU in Simulink 2016a? Has someone code?

2 ビュー (過去 30 日間)
Chong LI
Chong LI 2018 年 6 月 13 日
回答済み: Yash 2025 年 1 月 20 日
Hello,everyone,i am newer and want to load an FMU in Simulink. I know how to add a FMU CS block in Simulink by using code add_block, but cannot load an FMU automatically in this block. Does someone know what code to realize it. Thank you very much.

回答 (1 件)

Yash
Yash 2025 年 1 月 20 日 8:57
After adding the FMU Import Block using add_block, you can set the FMU file using set_param:
set_param(fmuBlockPath, 'FMUName', pathToFMUFile);
where fmuBlockPath is the path of the FMU Import Block added by add_block and pathToFMUFile is where your FMU file is located on the MATLAB path.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by