How to access to simulink finder using Matlab Script ?

1 次查看(过去 30 天)
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?

回答(1 个)

Ashok
Ashok 2024-10-14
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!

类别

Help CenterFile Exchange 中查找有关 Simulink Functions 的更多信息

产品


版本

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by