Main Content

Map Root Inport Signal Data

To import, visualize, and map signal and bus data to root-level input ports, use the Root Inport Mapper tool or the getRootInportMap function. At the top level of a model or referenced model, root-level input ports include:

  • Inport blocks

  • Enable blocks

  • Trigger blocks

Root-level input ports import data from the MATLAB® workspace based on the value of the Configuration Parameters > Data Import/Export > Input parameter.

Root-level inport mapping imports signal data in a way that meets most modeling requirements and maintains model flexibility. You can:

  • Test your model with signals from the workspace and use your model as a referenced model in a larger context without any modification.

  • Update the Input parameter based on the signal data you import and map to root-level inports.

  • Visually inspect signal data without loading all the data into MATLAB memory.

Tip

To determine whether another data import technique meets your specific modeling requirements (such as the amount of data or the storage location) better, see Comparison of Signal Loading Techniques.

Open the Root Inport Mapper Tool

Use either of these approaches to open the Root Inport Mapper tool:

  • In the Configuration Parameters > Data Import/Export pane, click Connect Inputs.

  • In the block parameters dialog box for the Inport block, select Connect Inputs.

Command-Line Interface

You can use the getRootInportMap to create a custom object to map signals to root-level input ports and getSlRootInportMap to create a custom map mode. For more information, see Create and Use Custom Map Modes.

Import and Mapping Workflow

  1. Identify and possibly create signal data to import and map.

  2. Import and View and Inspect Signal Data.

  3. Map the imported signal data. For example, you can map the signal data by block path or signal name.

  4. Simulate the model using the mapped data. After associating a scenario with the model, you can generate scripts for simulation with scenarios to perform batch simulations.

  5. Optionally, save the current Root Inport Mapper scenario for future reference or to share with other people.

Tip

To extend the Root Inport Mapper tool map modes, you can create a custom mapping file function to map data to root-level inports.

Choose a Map Mode

To specify how you want the Root Inport Mapper tool to map the signal data to a model, select from these map modes in the Map Configuration section of the toolbar:

  • Block name — Connect signal data to ports based on the name of a root-level input port block.

  • Block path — Connect signal data to ports based on the path of a root-level input port block.

  • Signal name — Connect signal data to ports based on the name of the signal on a port.

  • Port order — Connect sequential port numbers to the imported data.

  • Custom — Connect signal data to ports based on the definitions in a custom mapping file.

Each supported input format supports one or more map modes. To import MATLAB timeseries data, for example, you use any map mode. To import data array signal data, use the port order map mode.

Root Inport Mapper Keyboard Shortcuts

The Root Inport Mapper uses these keyboard shortcuts.

ActionMenu ActionKeyboard

Open file.

Open

Ctrl+O

Save file.

Save

Ctrl+S

Link from spreadsheet.

From Spreadsheet

Ctrl+Shift+X

Link from MAT-file.

From MAT-File

Ctrl+Shift+M

Link from workspace.

From Workspace

Ctrl+Shift+B

Create and edit new scenario in MAT-file.

Signals > New MAT-File

Ctrl+N

Edit scenario in MAT-file.

Signals > Edit MAT-File

Ctrl+E

Check readiness of all mapped scenario datasets.

Check Readiness > Map All

Ctrl+Shift+A

Check readiness of the mapped datasets of the currently selected scenarios.

Check Readiness > Map Selected

Ctrl+Shift+S

Check readiness of the mapped disconnected datasets.

Check Readiness > Map Unconnected

Ctrl+Shift+U

Check readiness of the mapped datasets that previously failed a mapping.

Check Readiness > Map Failed

Ctrl+Shift+F

Check readiness of the mapped datasets that previously caused warnings.

Check Readiness > Map Warned

Ctrl+Shift+Y

Apply to model.

Apply to Model

Ctrl+M

Generate and MATLAB batch simulation file.

Generate Script

Ctrl+G

Unlink all scenarios.

Unlink all scenarios

Ctrl+U

Unlink selected scenarios.

Unlink selected scenarios

Ctrl+I

On macOS systems, use the Command key instead of the Ctrl key.

View and Inspect Signal Data

After you import signal or bus data, you can view and inspect signal data using tools such as:

For a summary of the other steps involved in using the Root Inport Mapper tool, see Import and Mapping Workflow.

See Also

|

Related Topics