get Simulink block libinfo in find_system

4 次查看(过去 30 天)
The 'Library' and 'ReferenceBlock' info from 'libinfo' is very useful, but 'libinfo' does not return as many blocks as find_system. In the case I am working on, find_system returns about 500 more blocks than libinfo. However, none of the block properties appear to be 'Library' or 'ReferenceBlock'. Is there anyway to obtain this? I use get(get_param(handlesReturnedByFind_System, 'handle')) to get block parameters.
Thanks is advance

采纳的回答

Fangjun Jiang
Fangjun Jiang 2024-7-30
编辑:Fangjun Jiang 2024-7-30
'ReferenceBlock' is a block property. 'Library' is not. You are probably looking for 'LinkStatus'.
model='f14';
open_system(model)
b=find_system(model,'FindAll','on','type','block','LinkStatus','resolved')
get_param(b,'ReferenceBlock')
ans =
'simulink/Sources/Band-Limited
White Noise'
>> lib=libinfo(model)
lib =
struct with fields:
Block: 'f14/Dryden Wind↵Gust Models/Band-Limited↵White Noise'
Library: 'simulink'
ReferenceBlock: 'simulink/Sources/Band-Limited↵White Noise'
LinkStatus: 'resolved'
If you are asking, in the returned info of libinfo(), where does that 'Library' info come from?
then, it is the file name (or library name) of the library block specified in 'ReferenceBlock'.
>> bdroot(lib.ReferenceBlock)
ans =
'simulink'

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Programmatic Model Editing 的更多信息

产品


版本

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by