Main Content

libinfo

Get information about library blocks referenced by model

    Description

    libdata = libinfo(modelName) returns an array of structures libdata, which describes the library blocks referenced by the model modelName and its subsystems and referenced models.

    example

    libdata = libinfo(modelName,Name=Value) 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 blocktype to "SubSystem".

    example

    Examples

    collapse all

    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' }
    
    

    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

    collapse all

    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.

    Type of library block to search in the model, specified as a string scalar or character vector.

    Example: blocktype="SubSystem"

    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"

    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"

    Option to follow links into the library blocks, specified as "on" or "off".

    Output Arguments

    collapse all

    An array of structures that describe the library blocks referenced by a model. Each structure has these fields:

    BlockPath to the instance of the library block in the model.
    LibraryName of the source library of the referenced block.
    ReferenceBlockPath to the library block in its source library.
    LinkStatusCurrent 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

    See Also

    Functions