主要内容

simulinkScreenshot

R2026b

Take a screenshot of a Simulink model, subsystem, or scope result

Since R2026b

    Description

    simulinkScreenshot(model) takes a screenshot of the specified Simulink model, subsystem, or scope result and displays it in a figure window. The specified model must be loaded before running simulinkScreenshot.

    example

    Examples

    collapse all

    Take a screenshot of a Simulink model and a block within that model.

    Load the sf_car model and take a screenshot of it.

    load_system("sf_car");
    simulinkScreenshot("sf_car");

    Screenshot of the sf_car model

    Take a screenshot of the Engine block inside the sf_car model.

    simulinkScreenshot("sf_car/Engine");

    Screenshot of the Engine block inside the sf_car model

    Take a screenshot of a Simulink scope result.

    Load the sf_car model and run the simulation. Then, take a screenshot of the Scope1 scope result.

    load_system("sf_car");
    sim("sf_car"); 
    simulinkScreenshot("sf_car/Scope1");
    

    Screenshot of the Scope1 scope result for the sf_car model

    Input Arguments

    collapse all

    Simulink model, subsystem, or scope name, specified as a string or character vector. Supported model types include Simulink models and their subsystems, as well as Stateflow charts. To specify a subsystem or scope, use the relative path from the model.

    Example: simulinkScreenshot("sf_car");

    Example: simulinkScreenshot("sf_car/Engine");

    Version History

    Introduced in R2026b