Main Content

Load Signal Data for Simulation

Load signal data for simulating a model

You can use several different approaches to load data into a model, including:

  • Root-level input ports — Import signal data from a workspace, using the Input configuration parameter to import it to a root-level input port of a Inport, Enable, or Trigger block. To import many signals to root-level input ports, consider using the Root Inport Mapper tool.

  • From File block — Read data from a MAT file, outputting the data as a signal.

  • From Spreadsheet block — Read data from Microsoft® Excel® spreadsheets or CSV spreadsheets, outputting the data as one or more signals.

  • Playback block — Load data from the workspace, a file, or the Simulation Data Inspector.

  • Source blocks — Add a source block, such Sine Wave block, to generate signals to input to another block.

  • Signal Editor block — Display, create, edit, and switch interchangeable scenarios.

  • Persistent data — Stream big data from a MAT file into a model.

You can create input signal data in a file, workspace variable, or model parameter. You can use data logged in a previous simulation, from another source, or create the data yourself. To determine which signal loading approach to use, see Comparison of Signal Loading Techniques.

Blocchi

espandi tutto

InportCreate input port for subsystem or external input
In Bus Element, Bus Element In Select input from external port
EnableAdd enable port to subsystem or model
TriggerAdd trigger or function port to subsystem or model
From FileLoad data from MAT file into Simulink model
From SpreadsheetRead data from spreadsheet
From WorkspaceLoad signal data from workspace into Simulink model
PlaybackLoad data from workspace, file, or Simulation Data Inspector
Signal BuilderCreate and generate interchangeable groups of signals whose waveforms are piecewise linear
Signal EditorDisplay, create, edit, and switch interchangeable scenarios

Funzioni

espandi tutto

getRootInportMapCreate custom object to map signals to root-level inports
convertToSLDatasetConvert contents of MAT-file to Simulink.SimulationData.Dataset object
getSlRootInportMapCreate custom object to map signals to root-level inports using Simulink mapping mode
createInputDatasetGenerate dataset object for root-level Inport or bus element ports in model
signalbuilder(Not recommended) Create and access Signal Builder blocks
signalBuilderToSignalEditorImport signal data and properties from Signal Builder block to Signal Editor block
getInputStringCreate comma-separated list of variables to map
Simulink.BlockDiagram.getInitialStateReturn initial state data of block diagram
Simulink.Bus.createMATLABStructCreate MATLAB structures that use the same hierarchy and attributes as buses
Simulink.SimulationData.createStructOfTimeseriesCreate structure of timeseries data to load as simulation input for bus
signalEditorStart Signal Editor

Argomenti

Signal Loading

Load Data to Root-Level Input Ports

Other Signal Loading Techniques