Main Content

Use Help Files with MEX Functions

You can document the behavior of your MEX functions by writing a MATLAB® script containing comment lines. The help command searches for a MATLAB script and displays the appropriate text.

For example, copy the following text from the arrayProduct.c MEX source file into a file, arrayproduct.m.

% arrayproduct.m Help file for arrayProduct MEX-file.
%  arrayProduct.c - example in MATLAB External Interfaces
%  Multiplies an input scalar (multiplier) 
%  times a 1xN matrix (inMatrix)
%  and outputs a 1xN matrix (outMatrix)
%  The calling syntax is:
% 		outMatrix = arrayProduct(multiplier, inMatrix)

%  This is a MEX-file for MATLAB.
%  Copyright 2007-2014 The MathWorks, Inc.

When you type:

help arrayproduct

MATLAB displays the comments.

See Also

Related Topics