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
0 个评论
采纳的回答
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 Center 和 File Exchange 中查找有关 Programmatic Model Editing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!