libinfo
Get information about library blocks referenced by model
Description
specifies the search criteria to find library blocks using one or more name-value arguments.
For example, to return library blocks that are Subsystem blocks, set
libdata
= libinfo(modelName
,Name=Value
)blocktype
to "SubSystem"
.
Examples
Find Library Blocks Referenced by a Model
Get the information for all the library blocks used in a specific model, including the block path, library name, library path, and link status.
Load the model.
model = "sldemo_fuelsys";
load_system(model);
Get the details about the library blocks referenced by the model.
libdata = libinfo(model)
libdata=5×1 struct array with fields:
Block
Library
ReferenceBlock
LinkStatus
Get the paths to the instances of the library block in the model.
{libdata(:).Block}'
ans = 5x1 cell
{'sldemo_fuelsys/Engine Gas Dynamics/Mixing & Combustion/System Lag'}
{'sldemo_fuelsys/Throttle...' }
{'sldemo_fuelsys/To Controller/Sensor Info' }
{'sldemo_fuelsys/fuel_rate_control/airflow_calc/Enumerated...' }
{'sldemo_fuelsys/fuel_rate_control/validate_sample_time/CheckRange' }
Find Specific Library Blocks Referenced by a Model
Get the information for specific library blocks used in a specific model, including the block path, library name, library path, and link status.
Load the model.
model = "sldemo_fuelsys";
load_system(model);
Get the details about the library blocks with a specific library version referenced by the model.
libdata = libinfo(model,libraryversion="14.0")
libdata = struct with fields:
Block: 'sldemo_fuelsys/Engine Gas Dynamics/Mixing & Combustion/System Lag'
Library: 'simulink_extras'
ReferenceBlock: 'simulink_extras/Additional...'
LinkStatus: 'resolved'
Input Arguments
modelName
— Name of model to search
string scalar | character vector
Name or handle of the model to search for referenced library blocks, specified as a string scalar or character vector.
Example: "sldemo_fuelsys"
Data Types: char
| string
Name-Value Arguments
Specify optional pairs of arguments as
Name1=Value1,...,NameN=ValueN
, where Name
is
the argument name and Value
is the corresponding value.
Name-value arguments must appear after other arguments, but the order of the
pairs does not matter.
Example: libinfo("sldemo_fuelsys",blocktype="SubSystem",LibraryVersion="7.1")
returns the details of the Subsystem blocks from a library with version number 7.1, which
are referenced by the model sldemo_fuelsys
.
You can specify any of the name-value arguments that you can use with find_system
.
blocktype
— Type of library block
string scalar | character vector
Type of library block to search in the model, specified as a string scalar or character vector.
Example: blocktype="SubSystem"
LibraryVersion
— Version number of library
double
Version number of the library to search for blocks, specified as a numeric scalar.
LibraryVersion
is the ModelVersion
of the
library at the time the link was created. For information on model versions, see Manage Model Versions and Specify Model Properties.
Example: LibraryVersion="7.1"
LookUnderMasks
— Option to search under masked subsystems
"all"
(default) | "none"
| "graphical"
| "functional"
Option to search under masked subsystems, specified as one of these values:
"all"
— Search includes all the masked subsystems."none"
— Search skips all masked subsystems."graphical"
— Search includes masked subsystems that contain only icon drawing commands and excludes the masked subsystems with workspaces, dialogs, help strings, and user interface (UI) elements."functional"
— Search includes masked subsystems that either have icon drawing commands or mask initialization commands, and excludes the masked subsystems with parameters, description, help strings, and UI elements.
Example: LookUnderMasks="none"
FollowLinks
— Option to follow links into library blocks
"on"
(default) | "off"
Option to follow links into the library blocks, specified as
"on"
or "off"
.
Output Arguments
libdata
— Array of structures that describe library blocks
struct
An array of structures that describe the library blocks referenced by a model. Each structure has these fields:
Block | Path to the instance of the library block in the model. |
Library | Name of the source library of the referenced block. |
ReferenceBlock | Path to the library block in its source library. |
LinkStatus | Current status of the link between the library block instance in the model
and its source library. For information on LinkStatus
parameter values, see Link Status. |
Version History
Introduced before R2006a
MATLAB 명령
다음 MATLAB 명령에 해당하는 링크를 클릭했습니다.
명령을 실행하려면 MATLAB 명령 창에 입력하십시오. 웹 브라우저는 MATLAB 명령을 지원하지 않습니다.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)