Call External Functions Encapsulated by coder.ExternalDependency

When a method of a class derived from coder.ExternalDependency defines the interface to an external function, you call the external function by calling the method.

Suppose you define the following method for a class named AdderAPI:

function c = adder(a, b)
    coder.cinclude('adder.h');
    c = 0;
    c = coder.ceval('adder', a, b);
end        
This method defines the interface to a function adder which has two inputs, a and b. In your MATLAB® code, call adder this way:
y = AdderAPI.adder(x1, x2); 

See Also

Related Examples

More About

Was this topic helpful?