Why am I unable to change the default value of a block parameter using the SET_PARAM function in Simulink 5.1 (R13SP1)?
9 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
The documentation for the SET_PARAM function is accessed by typing the following at the MATLAB prompt:
doc set_param
This documentation includes the following:
set_param('obj', 'parameter1', value1, 'parameter2', value2, ...), where 'obj' is a system or block path or 0, sets the specified parameters to the specified values. Use 0 to set the default value of a parameter or the values of session parameters.
However, I am unable to set the default value of a Simulink block parameter. For example, the following command fails to set the default value of the 'Amplitude' parameter in the Sine Wave block as 5 (instead of 1):
set_param(0, 'Amplitude', '5')
Akzeptierte Antwort
MathWorks Support Team
am 27 Jun. 2009
The documentation in Release 2009a (R2009a) has been updated in this regard.
Previous releases of the product documentation in the SET_PARAM section erroneously state that 0 can be used to set the default value of a parameter.
The default value of a Simulink block parameter cannot be changed using the SET_PARAM command. To work around this issue, create a custom library that contains blocks for which you have set the parameter values accordingly.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Sources finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!