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 次查看(过去 30 天)
I need help

采纳的回答

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

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Random Number Generation 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by