setExternalInput
Specify external input data for top-level input ports in simulation configured
using Simulink.SimulationInput
object
Description
simIn = setExternalInput(
adds the external input data simIn
,inData
)inData
to the simulation
configuration in the Simulink.SimulationInput
object
simIn
. When you run a simulation using a
SimulationInput
object that has external input data specified,
the software selects the Input model configuration
parameter and specifies the input data to load as inData
.
Use this function to specify external input data to load using top-level input ports in your model.
Examples
Input Arguments
Output Arguments
Tips
To specify input data to load for a block that has parameter to specify the data to load from the workspace, specify the block parameter value as a variable. Then, use the
setVariable
function to specify the value for the variable in the simulation configuration represented by theSimulationInput
object.For example, to specify the data to load for a From Workspace block, specify the Data parameter for the From Workspace block as a variable. Then, use the
setVariable
function to specify the value of the variable.To load input data from a file, ensure that the simulation can access the file that contains the input data. When you run simulations using the
parsim
andbatchsim
functions, you can send files to the workers using theAttachedFiles
name-value argument.
Version History
Introduced in R2017a
See Also
Objects
Functions
sim
|parsim
|batchsim
|setInitialState
|setVariable
|setBlockParameter
|validate