Borrar filtros
Borrar filtros

get Simulink block libinfo in find_system

19 visualizaciones (últimos 30 días)
Craig
Craig el 30 de Jul. de 2024 a las 15:54
Comentada: Craig el 30 de Jul. de 2024 a las 17:01
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

Respuesta aceptada

Fangjun Jiang
Fangjun Jiang el 30 de Jul. de 2024 a las 16:33
Editada: Fangjun Jiang el 30 de Jul. de 2024 a las 16:44
'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'

Más respuestas (0)

Categorías

Más información sobre Simulink Environment Customization en Help Center y File Exchange.

Productos


Versión

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by