Contenido principal

solverprofiler.getReportText

R2026b

Get Solver Profiler results as formatted text

Since R2026b

Description

txt = solverprofiler.getReportText(res) returns a report of the Solver Profiler results res as formatted text. The formatting makes the results both human readable and suitable for AI analysis.

The first section in the report provides an overview of the results, including model configuration details, profiling statistics, and the Solver Profiler diagnostics and recommendations. The sections that follow provide information about the solver events that occurred in the simulation, including a table with the details for each event.

example

txt = solverprofiler.getReportText(res,Name=Value) specifies options using one or more name-value arguments. For example, to return only a specific section of the results, specify the Section name-value argument.

example

Examples

collapse all

Analyze the solver performance for a model named MyModel using the Solver Profiler. Then, return the profiling results as formatted text.

mdl = "MyModel";
res = solverprofiler.profileModel(mdl);
txt = solverprofiler.getReportText(res);

Analyze the solver performance for a model named MyModel using the Solver Profiler. Then, get formatted text for only the Jacobian analysis section of the profiling results.

mdl = "MyModel";
res = solverprofiler.profileModel(mdl);
txt = solverprofiler.getReportText(res,Section="jacobian");

Input Arguments

collapse all

Solver Profiler results, specified as one of these options:

  • Structure of profiling results returned by the solverprofiler.profileModel function

  • A string or a character vector that defines the path to a MAT file that contains the profiling results

Data Types: struct | char | string

Name-Value Arguments

collapse all

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Example: txt = solverprofiler.getReportText(res,Section="jacobian",MaxRows=5) returns the Jacobian analysis section of the profiling results res and limits each table in the output to five rows.

Section of the profiling results to return, specified as one of these values:

  • "overview" — Session, model, and simulation metadata, statistics, and solver profiler diagnostics and recommendations

  • "exceptions" — Solver exceptions

  • "jacobian" — Jacobian analysis

  • "resets" — Solver resets

  • "inaccuratestates" — States with values less than or equal to the absolute tolerance for the entire simulation

  • "zerocrossing" — Zero-crossing events

  • "simscapestiffness" — Simscape™ stiffness analysis

By default, the function returns all sections of the profiling results.

Maximum number of rows in each table in the output, specified as a positive integer. By default, each table contains up to 20 rows.

Output Arguments

collapse all

Formatted profiling results, returned as a string.

Data Types: string

Version History

Introduced in R2026b