Main Content

Simulink.SFunctionBuilder.list

List inputs, outputs, parameters, library items, and states for S-Function Builder block

    Description

    elemList = Simulink.SFunctionBuilder.list(blk,elem) returns a structure that lists the items of type elem configured for the S-Function Builder block blk. Use the Simulink.SFunctionBuilder.list function to list configurations for:

    • Input ports

    • Output ports

    • Parameters

    • Library items

    • States

    elemList = Simulink.SFunctionBuilder.list(blk,elem,Format=listFormat) returns a list of the items of type elem configured for the S-Function Builder block blk using the format listFormat. You can return the list as a structure or a table.

    Input Arguments

    collapse all

    S-Function Builder block, specified as a block handle or as a string or a character vector that defines the block path.

    Tips

    • To get the block handle for a block in your model, use the getSimulinkBlockHandle function.

    • To get the block handle for the most recently selected or added block, use the gcbh function.

    Type of element to list, specified as one of these options:

    • 'Input' — Input ports

    • 'Output' — Output ports

    • 'Parameter' — Parameters

    • 'LibraryItem' — Library items

    • 'States' — States

    Data Types: char | string

    Format of list to return, specified as 'Structure' or 'Table'. When you do not specify the Format name-value argument, the Simulink.SFunctionBuilder.list function returns a structure.

    • 'Structure' — Return the list of elements configured for the S-Function Builder block as a structure. The fields in the structure depend on the type of element you specify.

    • 'Table' — Return the list of elements configured for the S-Function Builder block as a MATLAB® table. The columns in the table depend on the type of element you specify.

    Data Types: char | string

    Output Arguments

    collapse all

    List of elements configured for S-Function Builder block, returned as a structure or a MATLAB table.

    Version History

    Introduced in R2022a