Main Content

show

Open and highlight line range in MATLAB Editor

    Syntax

    Description

    example

    show(lr) opens the file associated with the line range lr in the MATLAB® Editor and highlights the line range.

    Examples

    collapse all

    This example shows how to create an slreq.TextRange object and link it to a requirement.

    Create an slreq.TextRange object that corresponds to line numbers 1 and 2 in the myAdd function.

    tr = slreq.createTextRange("myAdd.m",[1 2]);

    View the slreq.TextRange object in the MATLAB® Editor.

    show(tr);

    Load the myAddRequirements requirement set.

    rs = slreq.load("myAddRequirements");

    Get a handle to the requirement with the summary Add u and v.

    req = find(rs,Summary="Add u and v");

    Create a link from the slreq.TextRange object to the requirement.

    myLink = slreq.createLink(tr,req);

    Input Arguments

    collapse all

    Line range, specified as an slreq.TextRange object.

    Version History

    Introduced in R2022b