NTRUE

버전 1.0.0.0 (1.73 KB) 작성자: Jos (10584)
Logical array with a specific number of true values
다운로드 수: 1.9K
업데이트 날짜: 2006/9/15

라이선스 보기

NTRUE - Logical array with a specific number of true values
NTRUE(N,P,Q, ...) or NTRUE(N,[P Q ...]) creates a logical array of size
[P Q ...] with N randomly positioned true values. NTRUE(N,P) is short for
NTRUE(N,P,P). All arguments (N,P,Q,...) are positive scalars.

NTRUE(N) creates a N-ny-N matrix with N true values.

Example:
NTRUE(5,3,4) % creates a 3-by-4 matrix with 5 true (and 7 false)
values, for instance:
% 0 0 0 0
% 1 1 0 0
% 1 0 1 1

See also TRUE, FALSE, ONES, ZEROS,
and SLM, SHAKE, NONES (on the MatLab FEX)

인용 양식

Jos (10584) (2024). NTRUE (https://www.mathworks.com/matlabcentral/fileexchange/10924-ntrue), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R13
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Logical (Boolean) Operations에 대해 자세히 알아보기
도움

줌: randone1

Community Treasure Hunt

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

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

(sep 2006)
- algorithm after all checks
- replaced call to randperm by a direct call to sort