How to access to simulink finder using Matlab Script ?

2 Ansichten (letzte 30 Tage)
Mohamed
Mohamed am 23 Mai 2023
Beantwortet: Ashok am 14 Okt. 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?

Antworten (1)

Ashok
Ashok am 14 Okt. 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!

Kategorien

Mehr zu Simulink Functions finden Sie in Help Center und File Exchange

Produkte


Version

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by