Cartesian product

Implementation of cartesian product with sampling of tuples


Updated Mon, 15 Jun 2020 20:58:27 +0000

View License

This implementation of cartesian product includes two methods providing:
- the complete set resulting from the cartesian product of several subsets, returned as numeric matrix or two-dimensional cell,
- the successive tuples from the first index to the cardinal of the resulting set (without memory pre-allocation), returned numeric vector or one-dimensional cell.

These methods support subsets including both numeric and non-numeric elements, defined as numeric vectors or one-dimensional cells.

Cite As

Eric Ogier (2023). Cartesian product (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2018a
Compatible with R2016a and later releases
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes