主要内容

generateReport

R2026b

Create report from Simulink Profiler results

Since R2023a

    Description

    generateReport(res) creates an HTML report of the profiling results res that you generate by profiling a simulation using the Simulink Profiler. This syntax saves the report in the current folder. The HTML filename includes the name of the profiled model and the timestamp of the simulation that created the profiling results.

    example

    generateReport(res,filename) creates an HTML report of the profiling results res and saves the report using the path and filename filename.

    example

    Examples

    collapse all

    Profile the compilation and execution of a model named MyModel using the Simulink Profiler. Then, generate a report from the profiling results.

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

    The report 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 a report from the results and specify a custom filename for the report.

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

    The report is saved in the current folder in an HTML file named MyProfilingReport.

    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 R2023a