Error using wswor: The algorithm used for weighted selection without replacement has unexpectedly failed.

1 view (last 30 days)
Hey everyone,
I am using the datasample function in a rather big algorithm which is executed on a cluster. It fails relatively often and doesn't give an understandable error message.
The line that fails: Xkernel = datasample(X, numKernels, 2, 'Replace', false, 'Weights', R);
X is 2xN (N around 5000)
R is 1xN
I check before that R is non-negative and also that the number of Kernels "numKernels" is appropriate.
The error message: Error using wswor The algorithm used for weighted selection without replacement has unexpectedly failed.
Error in datasample (line 171) i = wswor(wgts,k);
I would really appreciate it if someone knew what is happening here.
kind regards, Lukas

Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!