Skip to content

mathworks/CompareRNG

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CompareRNG

Open in MATLAB Online View on File Exchange

A simple app to compare performance of the MATLAB® random number generators on your machine.

Random number generator (RNG) performance can vary a lot for different CPU or GPU hardware. It also depends on the choice of uniformly or normally distributed sample generation. Use this application to view side-by-side comparisons of RNG performance in MATLAB, and optionally the GPU-enabled RNGs.

Screenshot

Installation

To install the app from within MATLAB:

  • Open the Add-Ons panel by clicking the Add-Ons icon on the left sidebar of the desktop.
  • Search for "CompareRNG" in the search box at the top of the Add-Ons panel.
  • Select the app from the list and click the Install button.

For alternative installation methods, see Get and Manage Add-Ons.

Required Products

To use this app, you need:

Setup

To open the app, go to the Apps tab and expand the apps gallery by clicking the down arrow on the far right, then click on the app icon in the My Apps section.

Getting Started

To start measuring random number generator performance, select a CPU or GPU generator by ticking the box next to its name. The app then computes the results for that generator. You can also select or deselect all CPU or GPU generators using the parent entries CPU or GPU.

By default, the app measures the performance of generating large arrays of random numbers using the rand function. To instead measure the performance of normally-distributed random number generators, you can choose to use the randn function.

The plotted data can be exported to the MATLAB workspace as a table for further analysis using the Export to Workspace button.

If MATLAB cannot find your GPU, use the validateGPU function to help diagnose the issue.

License

The license is available in the license.txt file in this GitHub repository.

Community Support

MATLAB Central

Copyright 2025 The MathWorks, Inc.

About

A simple app to compare performance of the MATLAB® random number generators on your machine.

Resources

License

Security policy

Stars

Watchers

Forks

Packages

No packages published