Contenido principal

slreq.createTextRange

Create line ranges

Since R2022b

    Description

    lr = slreq.createTextRange(fileName,lines) creates a line range associated with the lines of code, lines, in the file specified by fileName.

    example

    lr = slreq.createTextRange(fileName,blockSID,lines) creates a line range in the MATLAB Function block specified by blockSID.

    example

    Examples

    Input Arguments

    collapse all

    Name of the file containing the lines of code, specified as a string scalar or character vector.

    Example: "myAdd.m"

    Start and end line numbers for the line range, specified as a double array of the form [start end] or a scalar double.

    Example: [1 4], 1

    MATLAB Function block SID, specified as a string scalar or character vector.

    Example: "30"

    Output Arguments

    collapse all

    Line range, returned as an slreq.TextRange object.

    Tips

    • You can also use the createTextRange method of slreq.LinkSet to create line ranges.

    Version History

    Introduced in R2022b