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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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