When I create a MEX file in MATLAB, I'm in the habit of also creating a .m
file with the same name, a function signature identical to the MEX file, and otherwise containing nothing but help text in the form of comments, that are then displayed when one types help myfcn
.
When one does this, a small side-effect is that MATLAB Code Analyzer picks up on the fact that the input and output arguments specified in the function signature are unused, and flags them with an orange underline.
Recently I've discovered that several MathWorks internal functions follow something similar to this pattern, but also including the following line, separated by a blank line from the main help text:
%#mex
This %#mex
pragma appears to be undocumented (at least I can't find any reference to it).
It would appear to be used to directly indicate that a .m
file is intended only to provide help text for a MEX file. It has the effect of suppressing any Code Analyzer messages in the file.
Is anyone familiar with the intended use of the %#mex
pragma? Does it have any other effects other suppressing Code Analyzer messages?
Examples:
\toolbox\compiler\mcc.m
\toolbox\images\images\private\ddist.m
\toolbox\matlab\audiovideo\private\readavi.m
\toolbox\matlab\imagesci\hdf.m
\toolbox\matlab\sparfun\arpackc.m
\toolbox\matlab\specgraph\private\ditherc.m