MATLAB Answers

How to access Simulink Model callbacks like PreLoadFcn, InitFcn, StopFcn from matlab command window?

6 ビュー (過去 30 日間)
Keerthana R O
Keerthana R O 2021 年 7 月 29 日
回答済み: Fangjun Jiang 2021 年 7 月 29 日
I need to access the commands present inside Model Callbacks like PreLoadFcn, PostLoadFcn, InitFcn, StartFcn, StopFcn from the matlab command line for some scripting purpose. Is there any way to do with some inbuilt functions or any other way?

回答 (1 件)

Fangjun Jiang
Fangjun Jiang 2021 年 7 月 29 日
Model='f14';
open_system(Model)
get_param(Model,'PreLoadFcn');
set_param(Model,'PreLoadFcn','YourFunctionName')

Community Treasure Hunt

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

Start Hunting!

Translated by