Download Help (Windows Only) |
Owning Class: statistics
Requires: MathScript RT Module
y = randsample(v, k)
y = randsample(v, k, r)
y = randsample(v, k, true, w)
Returns a vector with elements that are uniformly sampled from a set.
Name | Description |
---|---|
v | Specifies the set that is uniformly sampled to form the output. v is a vector or positive integer that means the vector 1:v. |
k | Specifies the length of the output vector. |
r | Specifies whether each element in v can be sampled more than once. The default is false. |
w | Specifies the weights for the elements in v. w is a real vector with the same length as v. You can only specify w when r is true. |
Name | Description |
---|---|
y | Returns the vector with elements that are uniformly sampled from v. |
The following table lists the support characteristics of this function.
Supported in the LabVIEW Run-Time Engine | Yes |
Supported on RT targets | Yes |
Suitable for bounded execution times on RT | Not characterized |
V = 'National Instruments';
Y = randsample(V, 6);