when vector has one element, the result of randsample is not correct for my problem. It returns a random number from 1 to that element.
for example:
n=[3]; x = randsample(n,1);
randsample returns x=1 or x=2 or x=3
but I want x=3 only
randomStatistics and Machine Learning Toolbox
n=[3]; x = randsample(n,1);
Best Answer