0
\$\begingroup\$

Some example models that are included in the Simulink library, there are some variables that their value is not visible. For instance, in the model power_PVarray_grid_det the sample time of the powergui is defined as Ts_Power. I can not figure out the value of this variable. Is there a way to find these hidden variables, have access to them and change their value?

\$\endgroup\$

1 Answer 1

0
\$\begingroup\$
  1. Click the File/Model Properties/Model Properties item in the model window menu

  2. Select the Callbacks tab in the model properties dialog window

Then you can see that the PreLoadFcn callback is defined as follows: enter image description here

This code is executed before the model is loaded, so Ts_Power is initialized to 10^-6.

\$\endgroup\$
3
  • \$\begingroup\$ thank you. Do you know if there is a way to edit these variables through command line or a script? \$\endgroup\$
    – Yiannis S.
    Commented Jan 16, 2019 at 8:32
  • 2
    \$\begingroup\$ I was about to post this. Save the example locally and remove those variables out of the callback. \$\endgroup\$
    – user16222
    Commented Jan 16, 2019 at 8:36
  • \$\begingroup\$ You can also call your own script from the callback \$\endgroup\$
    – AVK
    Commented Jan 16, 2019 at 8:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.