Block Callback: How do I access block parameters in StartFcn?

조회 수: 1 (최근 30일)
Viren
Viren 2014년 3월 20일
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개)

카테고리

Help CenterFile Exchange에서 Author Block Masks에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by