Simulink.sfunction.Analyzer class

Package: Simulink.sfunction
Superclasses:

Create a Simulink 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 APIs. If no source code is available on the specified path, the analysis is skipped.

Construction

sfunAnalyzer = Simulink.sfunction.Analyzer(model) 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(model,'BuildInfo',{bdInfo}) creates a Simulink.sfunction.Analyzer object with the model and a Simulink.sfunction.analyzer.BuildInfo object named bdInfo.

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

Input Arguments

expand all

Names of the model in the path, specified as a string or character vector.

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside quotes. You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

Example: 'BuildInfo', {buildInfo}

A cell array of buildinfo objects. See Simulink.sfunction.analyzer.BuildInfo for more information.

An object to specify S-function analyzer running options. These checks include Polyspace® Code Prover™ and parameter robustness checks. See Simulink.sfunction.analyzer.Options for more information.

Methods

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