Contenido principal

explainWithAI

R2026b

Generate explanation of Simulink Profiler results using AI

Since R2026b

    Description

    explainWithAI(res) generates an explanation of the Simulink Profiler results res using AI. This syntax saves the explanation in an HTML file in the current folder. The HTML filename includes the name of the profiled model and a timestamp.

    To generate AI explanations, you must have a Simulink® Copilot license.

    example

    explainWithAI(res,filename) saves the AI explanation in an HTML report with the name and path specified by filename.

    example

    Examples

    collapse all

    Profile the compilation and execution of a model named MyModel using the Simulink Profiler. Then, access the results and generate an explanation of the results using AI.

    mdl = "MyModel";
    out = sim(mdl,Profile="on");
    res = out.SimulationMetadata.TimingInfo.ProfilerData;
    explainWithAI(res)

    The explanation is saved in an HTML file in the current folder.

    Profile the compilation and execution of a model named MyModel using the Simulink Profiler. Then, generate an AI explanation of the results and specify a custom name for the HTML file that contains the explanation.

    mdl = "MyModel";
    out = sim(mdl,Profile="on");
    res = out.SimulationMetadata.TimingInfo.ProfilerData;
    explainWithAI(res,"MyProfilingResults")

    The explanation is saved in the current folder in an HTML file named MyProfilingResults.

    Input Arguments

    collapse all

    Profiling results, specified as a Simulink.profiler.Data object.

    Custom filename and path, specified as a string or a character vector. If you want to save the report in the current folder, you can specify only the filename.

    If you do not specify a path or filename, the function saves the report in the current folder using a name that includes the name of the profiled model and a timestamp.

    Data Types: char | string

    Version History

    Introduced in R2026b