​​Simulink® model elements as objects​

Represent Simulink® model elements as MATLAB® objects, with enhanced search and batch operation capabilities.

You are now following this Submission

Simulink® Model Elements as MATLAB® Objects
Introduction
The slelement package is a working prototype for the ideas of
1. Representing Simulink model elements as MATLAB objects, usable with Simulink APIs (get_param, add_block, etc)
2. Searching model elements with an extensible sementic
3. Doing batch operations on model elements
Examples
Complete API cheatsheet, and live demos are under the doc directory. Below is just a sample of what you can do.
Making objects out of identifiers
Use the "makeElement" helper to create model element objects.
mdl = slelement.makeElement('modelname')
blk = slelement.makeElement('modelname/blockname')
Finding elements and performing batch operations
Find all the ports connected to outport blocks:
element_selector = ...
Ports('porttype','outport') > ... % all output ports connected to
( Blocks('blocktype','Outport') | ... % outport blocks'
Ports('porttype','inport') ); % inports
outport_inputs = mdl.select(element_selector);
Turn on port value labels for all of them:
outport_inputs.set('ShowValueLabel','on');
Copyright 2024 The MathWorks, Inc.

Cite As

Ken Xu (2026). ​​Simulink® model elements as objects​ (https://www.mathworks.com/matlabcentral/fileexchange/160606-simulink-model-elements-as-objects), MATLAB Central File Exchange. Retrieved .

Tags

Add Tags

Add the first tag.

General Information

MATLAB Release Compatibility

  • Compatible with R2017b and later releases

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.0.1

Fixed uploaded file.

1.0.0