Main Content


MATLAB benchmark



t = bench measures the execution time of six different benchmarking tasks on your computer and compares the results to several benchmark computers. The function:

  • Returns a 1-by-6 vector with the measured execution times

  • Displays execution times for the benchmark computers

  • Creates a bar graph that ranks the computers based on their speed


A benchmark is intended to compare the performance of one particular MATLAB® release on different computers. It does not offer direct comparisons between different MATLAB releases because tasks and problem sizes change from release to release.

t = bench(N) runs each of the six tasks N times and returns an N-by-6 array with the execution times. If N is zero, the function does not run any of the tasks on your computer, but instead displays the execution times for other computers and compares their speeds.

Fluctuations of 5–10% in the measured times of repeated runs on a single computer are normal.


collapse all

Measure the execution time of the six benchmarking tasks on your computer and compare the results to other benchmark computers.

t = bench

t = 1×6

    1.5649    1.2904    0.4593    4.1852    1.5169    4.8694

Input Arguments

collapse all

Number of times to run the six tasks, specified as a nonnegative integer.

More About

collapse all

Benchmarking Tasks

The six benchmarking tasks are listed in this table.

TaskDescriptionPerformance Factors
LUPerform lu of a full matrixFloating-point, regular memory access
FFTPerform fft of a full vectorFloating-point, irregular memory access
ODESolve van der Pol equation with ode45Data structures and MATLAB function files
SparseSolve a symmetric sparse linear systemMixed integer and floating-point
2-DPlot Lissajous curves2-D line drawing graphics
3-DDisplay colormapped peaks with clipping and transforms 3-D animated OpenGL graphics

The LU and FFT tasks involve large matrices and long vectors.

The 2-D and 3-D tasks measure graphics performance, including support for hardware-accelerated graphics. The rendererinfo function provides information about the graphics renderer implementation that MATLAB uses. For example, this command gets the information for the current axes and stores it in a structure called info.

info = rendererinfo(gca)

Version History

Introduced in R2008a

expand all

See Also

| | | |