Contenido principal

solverprofiler.explainWithAI

R2026b

Generate explanation of Solver Profiler results using AI

Since R2026b

Description

expl = solverprofiler.explainWithAI(res) generates an explanation of the Solver Profiler results res using AI and returns the explanation as a string. The AI explanation summarizes key findings, identifies potential bottlenecks, and provides recommendations to improve simulation performance.

If the profiling results already contain an AI explanation, the function returns the existing explanation.

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

example

expl = solverprofiler.explainWithAI(res,Timeout=t) specifies the timeout t for generating the AI explanation.

Examples

collapse all

Analyze the performance of the selected solver for a model named MyModel using the Solver Profiler. Then, generate an explanation of the profiling results using AI.

mdl = "MyModel";
res = solverprofiler.profileModel(mdl);
expl = solverprofiler.explainWithAI(res);

The AI explanation is returned as a string.

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

Maximum time to wait for the AI explanation, specified as a positive scalar number with units of seconds. By default, the function waits up to 300 seconds for the explanation.

If the function does not generate the explanation within the specified amount of time, the function issues an error.

Output Arguments

collapse all

AI explanation of the profiling results, returned as a string.

Data Types: string

Version History

Introduced in R2026b