| MATLAB Compiler | ![]() |
Using feval
In stand-alone C and C++ modes, the pragma
informs the MATLAB Compiler that the specified function(s) should be included in the compilation, whether or not the Compiler's dependency analysis detects it. Without this pragma, the Compiler's dependency analysis will not be able to locate and compile all M-files used in your application.
You cannot use the %#function pragma to refer to functions that are not available in M-code.
Example - Using %#function
A good coding technique involves using %#function in your code wherever you use feval statements. This example shows how to use this technique to help the Compiler find the appropriate files during compile time, eliminating the need to include all the files on the command line.
function ret = mywindow(data,filterName) %MYWINDOW Applies the window specified on the data. % % Get the length of the data. N= length(data); % List all the possible windows. %#function bartlett, barthannwin, blackman, blackmanharris, ... bohmanwin, chebwin, flattopwin, gausswin, hamming, hann,... kaiser, nuttallwin, parzenwin, rectwin, tukeywin, ... triang window = feval(filterName,N); % Apply the window to the data. ret = data.*window;
| Interfacing M-Code to C/C++ Code | Script Files | ![]() |
© 1994-2005 The MathWorks, Inc.