setBlockParameter
Set block parameter values for simulation using
SimulationInput
or Simulation
object
Description
specifies the value of the block parameter s
= setBlockParameter(s
,blkpath
,blkparam
,paramval
)blkparam
as
paramval
for block blkpath
on the
Simulink.SimulationInput
or Simulation
object s
.
When
s
is aSimulationInput
object, you can specify only a single value to use for the entire simulation.When
s
is aSimulation
object, you can specify a single value to use at the start of the simulation and specify new values for tunable parameters during normal and accelerator simulations.Tuning block parameter values during rapid accelerator simulations is not supported.
You can use the setBlockParameter
function to specify
parameter values on a SimulationInput
or
Simulation
object for any block throughout a model hierarchy.
The parameter values you specify override the values saved in the model for
simulations you run using the SimulationInput
or
Simulation
object during simulation and are reverted when the
simulation completes. You can use a SimulationInput
or
Simulation
object to override any number of parameter
values.
Note
The setBlockParameter
function is not supported for
rapid accelerator simulations that disable the rapid accelerator up-to-date
check or for deployment. To modify block parameter values in these
simulations, use a variable to specify the block parameter value, and then
use the setVariable
function to
specify the variable value.
Examples
Input Arguments
Output Arguments
Tips
Use the
getBlockParameter
function to get the value of a block parameter specified on aSimulationInput
object or aSimulation
object.paramval = getBlockParameter(s,blkpath,"ParamName");
Use the
removeBlockParameter
function to remove a block parameter from aSimulationInput
object or aSimulation
object.s = removeBlockParameter(s,blkpath,"ParamName");