how find Specified two module names by find_system API

3 visualizzazioni (ultimi 30 giorni)
hello all,
I want to find the Subsystem in the Specified Path. but the Subsystem's Name is Runnable or Subsystem's Name is Function.
I only can find a Name, I don't find two Name.
lockPath=find_system([MODEL_NAME,'/',MODEL_NAME,'/Subsystem/',MODEL_NAME],'regexp','on','blocktype','SubSystem','Name',{'Runnable','Function'});
Can you find two Name ?

Risposte (1)

Sameer
Sameer il 22 Ago 2024
Hi
From my understanding, you want to search for subsystems within a specific path in your Simulink model that have the names "Runnable" or "Function".
To achieve this, you can modify “find_system” function to include a regular expression that matches both the names.
Here's how you can do it:
lockPath = find_system([MODEL_NAME, '/', MODEL_NAME, '/Subsystem/', MODEL_NAME], ...
'regexp', 'on', ...
'blocktype', 'SubSystem', ...
'Name', '^(Runnable|Function)$');
Please refer to the below MathWorks documentation link:
Hope this helps!

Categorie

Scopri di più su Programmatic Model Editing in Help Center e File Exchange

Prodotti

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by