Effacer les filtres
Effacer les filtres

How can I get the number of tunable parameters and number of observable signals in a Simulink model?

1 vue (au cours des 30 derniers jours)
How can I get the number of tunable parameters and number of observable signals in a Simulink model? This used to be accomplished by:
tg = slrt;
tg.NumParameters
tg.NumSignals
But this has changed in the latest version of Matlab. There isn't any documentation on what these might have changed to.

Réponses (1)

Pratyush
Pratyush le 25 Oct 2023
Hi Jeffrey,
I understand that you want to get the tunable parameters and the observable signals in a Simulink model.
You can use Simulink Real-Time Explorer for it. You can refer to the following link for more details on Simulink Real-Time Explorer: https://in.mathworks.com/help/slrealtime/ref/simulinkrealtimeexplorer-app.html
Here's how you can do it:
  1. Open your Simulink model.
  2. Run a simulation of the model.
  3. Open the Simulation Data Inspector by typing Simulink.sdi.view in the MATLAB command window.
  4. In the Simulation Data Inspector window, click on the "Signals & Parameters" tab.
  5. Under the "Signals" section, you will find the list of observable signals. The number of observable signals is displayed at the bottom of this section.
  6. Under the "Parameters" section, you will find the list of tunable parameters. The number of tunable parameters is displayed at the bottom of this section.
Hope this helps.
  1 commentaire
Jeffrey
Jeffrey le 26 Oct 2023
Hello, Pratyush, thanks for your answer. I cannot use Simulink Real-Time Explorer, because I am modifying some older code that uses NumParameters and NumSignals, and I need it to be in MATLAB code. So, I don't have the option for interactivity.

Connectez-vous pour commenter.

Produits


Version

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by