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
sis aSimulationInputobject, you can specify only a single value to use for the entire simulation.When
sis aSimulationobject, 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
getBlockParameterfunction to get the value of a block parameter specified on aSimulationInputobject or aSimulationobject.paramval = getBlockParameter(s,blkpath,"ParamName");Use the
removeBlockParameterfunction to remove a block parameter from aSimulationInputobject or aSimulationobject.s = removeBlockParameter(s,blkpath,"ParamName");