| Contents | Index |
buildInstrumentedMex fcn -options
buildInstrumentedMex fcn -options translates the MATLAB file fcn.m to a MEX function and enables instrumentation for logging minimum and maximum values of all named and intermediate variables.
Note Instrumentation results are accumulated every time the instrumented MEX function is called. Use clearInstrumentationResults to clear previous results in the log. Arrays of structures are not logged. Only scalar (1x1) structures are logged. You cannot instrument MATLAB functions. If your top-level function is a MATLAB function, nothing is logged. |
fcn |
MATLAB function to be instrumented. fcn must be suitable for code generation. For more information, see Making the MATLAB Code Suitable for Code Generation. |
Create an instrumented MEX function. Run a test bench, then view logged results.
Create a temporary directory, then import a demo function from Fixed-Point Toolbox.
tempdirObj=fidemo.fiTempdir('showInstrumentationResults')
copyfile(fullfile(matlabroot,'toolbox','fixedpoint',...
'fidemos','fi_m_radix2fft_withscaling.m'),...
'testfft.m','f')Define prototype input arguments.
n = 128; x = zeros(n,1); W = coder.Constant(fi(fidemo.fi_radix2twiddles(n));
Generate an instrumented MEX function. Use the -o option to specify the MEX function name.
buildInstrumentedMex testfft -o testfft_instrumented...
-args {x,W}Run a test bench to record instrumentation results. Call showInstrumentationResults to open the Code Generation Report. View the simulation minimum and maximum values and whole number status by hovering over a variable in the report.
for i=1:20 y = testfft_instrumented(randn(size(x))); end showInstrumentationResults testfft_instrumented

Clear the results log.
clearInstrumentationResults testfft_instrumented
Clear the MEX function, then delete temporary files.
clear testfft_instrumented; tempdirObj.cleanUp;
clearInstrumentationResults | codegen | fiaccel | mex | showInstrumentationResults

Learn how to apply early verification to your development process through these technical resources.
How much time do you spend on testing to ensure implementation meets system-level requirements?
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |