How to access to simulink finder using Matlab Script ?

2 views (last 30 days)
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?

Answers (1)

Ashok
Ashok on 14 Oct 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!

Categories

Find more on Simulink Functions in Help Center and File Exchange

Products


Release

R2022a

Community Treasure Hunt

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

Start Hunting!