<< cell2table Timeseries/Table detectImportOptions >>

Scilab Help >> Planilhas > Timeseries/Table > combinations

combinations

Create a table containing all element combinations

Syntax

t = combinations(v1, ..., vn)

Arguments

v1, ..., vn

double, string, boolean, datetime or duration matrix

t

A table

Description

t = combinations(v1, .., vn) creates a table containing all element combinations of inputs v1, .., vn, where v1, ..., vn can be of different type and size.

The properties of t are as follows:

Examples

Combinations of two vectors of doubles

v1 = [1; 2; 3];
v2 = [4; 5];
c = combinations(v1, v2)

Combinations of vectors/matrix

v1 = [1; 2; 3];
v2 = [4 5];
c = combinations(v1, v2)

v3 = [1; 7; 4];
v4 = [8 5; 2 6];
v5 = [0 1];
c = combinations(v3, v4, v5)

Combinations of vectors of different types

a = ["A"; "B"; "C"];
d = 0:2;
b = [%t; %f];

cc = combinations(a, d, b)

dt = [datetime("yesterday"); datetime("today"); datetime("tomorrow")];
dura = hours(0:10:24);
cc2 = combinations(dt, dura)

See also

History

VersionDescription
2025.1.0 Introduction in Scilab.

Report an issue
<< cell2table Timeseries/Table detectImportOptions >>