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