How to access to simulink finder using Matlab Script ?

3 visualizaciones (últimos 30 días)
Mohamed
Mohamed el 23 de Mayo de 2023
Respondida: Altaïr el 14 de Oct. de 2024
I want to pass a string text to Simulink Finder to look it up in the model (include stateflow) and then if it exists highlight it, how can I do this using Matlab Code?

Respuestas (1)

Altaïr
Altaïr el 14 de Oct. de 2024
The ‘find_system’ function in the Programmatic Model Editing enables to search for blocks, subsystems and signals by name. Similarly, the ‘find’ function in the Stateflow Programmatic Interface can be used to achieve the same with charts and transitions. Here are the relevant documentation links.
An example is provided in the attached zip file. The code in the ‘script.m’ file searches the ‘example.slx’ Simulink model for the entities whose names contain the string ‘BL55’ and highlights them. The ‘hilite_system’ and ‘highlight’ functions are used to perform highlighting actions. You can learn more about them in the following documentation pages.
On executing the script, the corresponding Simulink entities get highlighted as shown below.
Note that any interactions with the Stateflow chart will disable the highlighting. As a workaround you can navigate inside the Stateflow chart and highlight one chart/transition at a time, after finding them.
I believe this will assist you!

Categorías

Más información sobre Simulink Functions en Help Center y File Exchange.

Productos


Versión

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by