Contenuto principale

coder.MATLABCoderBuildHooks Class

R2026b

Namespace: coder

Interface class for MATLAB Coder build hooks

Since R2026b

Description

The coder.MATLABCoderBuildHooks class provides an interface with overridable methods corresponding to MATLAB® Coder™ build hook points.

To create a custom build hook class, derive your class from coder.MATLABCoderBuildHooks and override the methods that you want to customize. Methods that you do not override default to empty implementations.

To trigger the build hooks, place your custom class definition in the MATLAB path, then register your hooks to your target hardware using the target API. For an example, see Customize Build Process for Target Hardware Using Target Framework.

Methods

expand all

Examples

collapse all

Implement a subclass MyTargetMATLABCoderBuildHook of coder.MATLABCoderBuildHooks that overrides the methods of the interface class. Define the overriding methods to print to console at each step of the build process.

classdef MyTargetMATLABCoderBuildHook < coder.MATLABCoderBuildHooks
    methods
        function entry(this, context)
            disp("entry build hook was called");
        end
        function afterCodeGeneration(this, context)
            disp("afterCodeGeneration build hook was called")
        end
        function afterMake(this, context)
            disp("afterMake build hook was called")
        end
    end
end

Place the class definition in the MATLAB path.

Version History

Introduced in R2026b