Main Content

coder.Method Properties

Description of method in a MATLAB class used in code generation

coder.Method properties contain the description of a method in a MATLAB® class that is used in code generation. All coder.Method properties are read-only. You can use dot notation to query these properties.

You do not directly create a coder.Method object. A coder.ReportInfo object contains one coder.Method object for every method in the MATLAB classes that are used in code generation. These coder.Method objects are automatically created when you export code generation report information to a coder.ReportInfo object. For more information, see coder.ReportInfo Properties and Access Code Generation Report Information Programmatically.

This property is read-only.

Name of a method in a MATLAB class used in code generation, specified as a character vector.

Example: 'foo'

Data Types: char

This property is read-only.

Name of the class containing the method, specified as a character vector.

Example: 'MyClass'

Data Types: char

This property is read-only.

The specialization identifier of the method. A value of zero indicates that the method is not specialized. A positive value indicates that the method is specialized.

Data Types: double

This property is read-only.

The specialization identifier of the class containing the method. A value of zero indicates that the class is not specialized. A positive value indicates that the class is specialized.

Data Types: double

This property is read-only.

A description of the MATLAB file that contains the method used in code generation.

This property is read-only.

1-based index of the first character of the method in the text of the file. If the file does not contain text (for example, a P-coded file), this property is equal to 0.

To manually inspect the code, the line and column numbers corresponding to StartIndex are useful. Use the getLineColumn function to obtain that information.

Data Types: double

This property is read-only.

1-based index of the last character of the method in the text of the file. If the file does not contain text, this property is equal to 0.

To manually inspect the code, the line and column numbers corresponding to EndIndex are useful. Use the getLineColumn function to obtain that information.

Data Types: double

This property is read-only.

The array consists of one coder.Variable object for each variable the method uses, including input, output, and local variables.

Each coder.Variable object has these properties:

  • Name: Name of the variable, specified as a character vector.

  • Scope: Scope of the variable, specified as a character vector. Possible scope values are: 'Input', 'Output', 'Local', 'Global', 'Persistent', and 'InputOutput'.

  • Type: Data type of the variable specified as a coder.Type object.

This property is applicable only in the context of the MATLAB function report of a MATLAB Function block. See Programmatically Access MATLAB Function Reports (Simulink).

This property is read-only.

Heterogeneous array containing descriptions of MATLAB functions and methods that are called by the this method. Each element of the array contains a description of one function or method.

  • Array elements containing descriptions of functions are coder.Function objects. See coder.Function Properties.

  • Array elements containing descriptions of methods are coder.Method objects.

Version History

Introduced in R2019a