Main Content

Simulink.sfunction.Analyzer Class

Namespace: Simulink.sfunction
Superclasses:

Create S-function analyzer object

Description

This class enables you to perform checks on S-functions within a model or a library. These checks include MEX compiler setup check, source code check, MEX-file check, parameter robustness check for S-functions. The check result can be accessed either from a MATLAB® structure or an HTML report.

The S-function analyzer checks the source code of the S-functions based on the S-function names. The S-function source code can be automatically included in the analysis if the source file is a single C or CPP file in the MATLAB path that has the same name as the S-function. Otherwise, the build information can be specified through the S-function Analyzer programmatic interface. If no source code is available on the specified path, the analysis is skipped.

Construction

sfunAnalyzer = Simulink.sfunction.Analyzer(mdl) creates a Simulink.sfunction.Analyzer object with the model you specify. In this case, the source code for the S-function can be automatically included in the analysis if the source code file is a single C or CPP file in the MATLAB path that has the same name as the S-function. For example, if the specified model contains an S-function called mysfun, and the source file for mysfun is a single file mysfun.c in the MATLAB path, a Simulink.sfunction.analyzer.BuildInfo object is automatically created and included in the analysis.

sfunAnalyzer = Simulink.sfunction.Analyzer(mdl,'BuildInfo',{bdInfo}) creates a Simulink.sfunction.Analyzer object with the model and a Simulink.sfunction.analyzer.BuildInfo object named bdInfo.

sfunAnalyzer = Simulink.sfunction.Analyzer(mdl,'Options',{opts}) creates a Simulink.sfunction.Analyzer object with the model and a Simulink.sfunction.analyzer.Options object named opts.

Input Arguments

expand all

Name of model ion MATLAB path, specified as a string or character vector.

Name-Value Arguments

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.

Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

Example: 'BuildInfo',{buildInfo}

Build information, specified as a cell array of Simulink.sfunction.analyzer.BuildInfo objects.

S-function analyzer options, specified as a Simulink.sfunction.analyzer.Options object. These checks include Polyspace® Code Prover™ and parameter robustness checks.

Methods

generateReportGenerate an HTML report of S-function checks
runPerform checks on S-functions

Version History

Introduced in R2017b