Azzera filtri
Azzera filtri

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

1 visualizzazione (ultimi 30 giorni)
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.

Risposte (0)

Categorie

Scopri di più su Subsystems in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by