randpermmat(N, M)

버전 1.0.0.0 (1.91 KB) 작성자: Jos (10584)
Random permutation matrix
다운로드 수: 64
업데이트 날짜: 2018/2/21

라이선스 보기

randpermmat - random permutation matrix
A = randpermmat(N) returns a square matrix where each row and each column
holds a permutation of the integers 1:N. This is also known as a random
Latin Square where each integer occurs exactly once in each row and each
column.

A = randpermmat(N, M) returns a N-by-M matrix where each row contains N
and each column contains M unique integers selected randomly from 1:K,
where K is the largest value of N and M. Again, each value is present
at most once in each row and column.

Example:
X = randpermmat(3,5) % might return
% X = [ 2 3 1 5 4
% 3 1 5 4 2
% 1 5 4 2 3 ]
% In this example, M(=5) > N(=3), and each row is therefore a random
% permutation of all integers 1:5, and each column holds 3 unique
% values selected randomly from 1:5
% (all rows of sort(X,2) will be 1:5)

See also randperm, randi, randsample
latsq, shake, randswap (on the file Exchange)

인용 양식

Jos (10584) (2024). randpermmat(N, M) (https://www.mathworks.com/matlabcentral/fileexchange/66147-randpermmat-n-m), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2017b
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Modeling and Prediction에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!
버전 게시됨 릴리스 정보
1.0.0.0