Block Callback: How do I access block parameters in StartFcn?
2 次查看(过去 30 天)
显示 更早的评论
I have a virtual subsystem with a bunch of parameters. I would like to use those parameters to calculate other properties of the block. This needs to be done before the simulation starts, but AFTER the block has been initialized.
I tried to create a script that would use these parameters to calculate other variables, which would run from the StartFcn block callback. But, the script cannot access the parameters (which are input by the user through the mask) in the callback. I'm guessing this is because those parameters aren't available in the Matlab workspace.
Is there any way to access those parameters through StartFcn? Failing that, is there another way, instead of the StartFcn, through which I can perform some calculations BEFORE simulation starts?
To clarify, I cannot use the Initialization tab in the mask of the block because the script also requires data from other blocks, which are available in the workspace at the start of the simulation.
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Subsystems 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!