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 Ansicht (letzte 30 Tage)
I need help

Akzeptierte Antwort

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

Weitere Antworten (0)

Kategorien

Mehr zu Random Number Generation finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by