Syntax
- p = randperm(n)
Description
p = randperm(n) returns a random permutation of the integers 1:n.
Remarks
The randperm function calls rand and therefore changes rand's state.
Examples
randperm(6) might be the vector
- [3 2 6 4 1 5]
or it might be some other permutation of 1:6.
말 그대로 랜덤으로 순열을 만드는 함수 이다.
v = randperm(5)
v
2 4 1 3 5
위와 같이 나올 수 있다.
반응형
'IT > MATLAB' 카테고리의 다른 글
| linspace(a, b, n) 함수 (0) | 2014.12.19 |
|---|---|
| [dlmwrite 함수] excel로 저장할때 데이터가 커서 오류가 날 경우 (0) | 2014.12.19 |
| 외부 데이터(파일) 불러오기와 저장하기 (0) | 2014.12.19 |
| cellfun 함수 (0) | 2014.12.19 |
| sub2ind 함수 (0) | 2014.12.19 |