How to set a system constant to be used in multiple blocks in Simulink
58 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hakan Tol
il 18 Ott 2019
Commentato: Hakan Tol
il 18 Ott 2019
I am beginner in Simulink.
I have a large system making use of same type of component models (each as user-defined Matlab function). I want to make a parametric study to evaluate the system for different parameter values at the component so I need to define the parameter values centrally. Is there a way to define the system parameters at one block (somehow it will generate the global variables) so the component model parameters will get updated automatically?
0 Commenti
Risposta accettata
Fangjun Jiang
il 18 Ott 2019
The general approach is to define a parameter (e.g. MyPar1) in base workspace or in a data dictionary, then you can use this parameter for multiple blocks (for example, specify the Gain as MyPar1 or the value of a Constant block as MyPar1).
In the case of MATLAB function block, you can click "Edit Data" in the Editor and then Add Data, specify the Scope as Parameter.
3 Commenti
Fangjun Jiang
il 18 Ott 2019
Yes. Just start withy MyPar1=1 in base workspace and then use it anywhere in your model.
Later, you can manage this in a "Simulink data dictionary".
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Interactive Model Editing 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!