On Tue, 24 Sep 2019, Ioannis A. Venetis wrote:
From what I see, Matlab uses
======
p = randperm(n)
p = randperm(n,k)
Description
p = randperm(n) returns a row vector containing a random permutation of
the integers from 1 to n inclusive.
p = randperm(n,k) returns a row vector containing k unique integers
selected randomly from 1 to n inclusive.
======
to create an index of integers that can be used then to select/permute
the columns (or rows) of a matrix
Thanks, Ioannis. Maybe this offers a way to break the current deadlock
over msample? We could easily rejig msample as randperm (quite nice to
have a Matlab-compatible function and no harm in using the same name)
and then leave it up to users how exactly they want to employ it.
The existing design use of msample on X (r x c), as in
matrix s = msample(X, n)
would become
matrix s = X[randperm(r,n),]
and anyone who wanted to subsample with order preserved could do
matrix s = X[sort(randperm(r,n)),]
Any takers?
Allin