addMethod
Add method specification to coder.ClassSignature object (Tech
Preview)
Since R2026a
Syntax
Description
When you specify a MATLAB® class as an entry point for code generation, use the
addMethod function to add methods to the coder.ClassSignature
object.
Note
Using a MATLAB class as an entry point for code generation is a tech preview. This
feature is in active development and may change between the tech preview and the general
release. The primary purpose of the tech preview is to solicit feedback from users. To
enable the feature, enter enableCodegenForEntryPointClasses at the
command line before calling the codegen function or creating a coder.Type object in a MATLAB session. To provide feedback, email the
development team or participate
in a survey.
addMethod(
adds the method specified by the classSig,fsObj)coder.FunctionSignature object fsObj to the coder.ClassSignature object
classSig.
addMethod(
adds the method classSig,methodName,args)methodName with the arguments args
to the coder.ClassSignature object classSig.
addMethod(
specifies options for classSig,methodName,args,Name=Value)methodName by using one or more name-value
arguments. For example, to set the number of output arguments to two, set
Nargout to 2.
Examples
Input Arguments
Name-Value Arguments
Extended Capabilities
Version History
Introduced in R2026a