how find Specified two module names by find_system API

3 visualizaciones (últimos 30 días)
Xiaoning.Wang
Xiaoning.Wang el 25 de Feb. de 2021
Respondida: Sameer el 22 de Ag. de 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 ?

Respuestas (1)

Sameer
Sameer el 22 de Ag. de 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!

Categorías

Más información sobre Programmatic Model Editing en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by