Main Content

clearInstrumentationResults

Clear results logged by instrumented, compiled C code function

Description

clearInstrumentationResults('mex_fcn') clears the results logged from calling the instrumented MEX function, mex_fcn.

clearInstrumentationResults mex_fcn is an alternative syntax for clearing the log.

example

clearInstrumentationResults all clears the results from all instrumented MEX functions.

Examples

collapse all

This example shows how to create an instrumented MEX function, run a test bench, then view logged results.

Define prototype input arguments.

n = 128;
x = complex(zeros(n,1));
w = fi_radix2twiddles(n);

Generate an instrumented MEX function. Use the -o option to specify the MEX function name. Use the -histogram option to compute histograms.

buildInstrumentedMex testfft -o testfft_instrumented -args {x,coder.Constant(w)} -histogram

If you have a MATLAB® Coder™ license, you can also add the -coder option. For example,

buildInstrumentedMex testfft -coder -o testfft_instrumented -args {x,w}

Like the fiaccel function, the buildInstrumentedMex function generates a MEX function. To generate C code, use the MATLAB® Coder™ codegen function.

Run a test file to record instrumentation results. Use the showInstrumentedMex function to open the report. To view the simulation minimum and maximum values and whole number status, pause over a variable in the report. You can also see proposed data types for double precision numbers in the table.

for i=1:20
   y = testfft_instrumented(randn(size(x)),w);
end

showInstrumentationResults testfft_instrumented

instrumentation-report-tb1.png

Close the histogram display, then use the clearInstrumentationResults function to clear the results log.

clearInstrumentationResults testfft_instrumented

Run a different test bench, then view the new instrumentation results.

for i=1:20
   y = testfft_instrumented(cast(rand(size(x))-0.5,'like',x),w);
end

showInstrumentationResults testfft_instrumented

instrumentation-report-tb2.png

To view the histogram for a variable, click the histogram icon in the Variables tab.

numeric-type-scope-x-tb2.png

Close the histogram display, then use the clearInstrumentationResults function to clear the results log.

clearInstrumentationResults testfft_instrumented

Clear the MEX function.

clear testfft_instrumented

Input Arguments

collapse all

Instrumented MEX function created using buildInstrumentedMex.

Version History

Introduced in R2011b