how find Specified two module names by find_system API

3 vues (au cours des 30 derniers jours)
Xiaoning.Wang
Xiaoning.Wang le 25 Fév 2021
Réponse apportée : Sameer le 22 Août 2024
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 ?

Réponses (1)

Sameer
Sameer le 22 Août 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!

Catégories

En savoir plus sur Programmatic Model Editing dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by