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 Center および File ExchangeRandom Number Generation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by