A Simulink.findVars equivalent for elements of a structure

조회 수: 3 (최근 30일)
Robert
Robert 2015년 11월 23일
답변: Chaitra Kulkarni 2015년 12월 2일
The parameters used in my Simulink model are organized into a many-level structure. I would like to find out which of the elements of that structure are being used by my model. Is there an existing tool for doing this?
It seems that Simulink.findVars won't look at individual structure elements but only at the structure as a whole, even with regular expression searching.
In case my intent is not clear, here are the details:
I have a large model that contains many referenced models, library-links, and masked blocks. My parameter structure is defined in the base workspace so as to be reachable by all of the referenced models. The structure contains many unused fields, which I would like to programmatically find and delete. The end result would ideally be a structure containing only fields used by the model.

답변 (1개)

Chaitra Kulkarni
Chaitra Kulkarni 2015년 12월 2일
The capability to find blocks in a Simulink model that use a specific field of a structure as their parameter using findVars is not available in Simulink as of now.
To workaround the issue, you can store the struct variable in a new variable and then use the new variable in the block.

카테고리

Help CenterFile Exchange에서 Event Functions에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by