How to generate random integer between two no (say 12 and 35) without repeat? randperm(n) give only 1 to n, but I need m to n.

1 view (last 30 days)
I need help

Accepted Answer

KSSV
KSSV on 10 Aug 2017
idx = 12:35 ;
N = length(idx) ;
iwant = randsample(idx,N) ;

More Answers (0)

Community Treasure Hunt

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

Start Hunting!