nones

버전 1.2 (1.91 KB) 작성자: Jos (10584)
fill each row/column with a certain number of ones (N-ONES)
다운로드 수: 1.8K
업데이트 날짜: 2019/2/18

라이선스 보기

NONES - fill each row/column with a certain number of ones (N-ONES)
A = NONES(V) creates a logical array A, in which each row/column
starts with zero or more TRUE entries followed by zero or more FALSE
entries, as specified by the elements of the vector V.

Examples
nones([1 0 4]) % ->
1 0 1
0 0 1
0 0 1
0 0 1

a = nones([-2 3 2 7].') ;
b = cumsum(a,2) ;
b(~a) = 0 % ->
0 0 0 0 0 0 0
1 2 3 0 0 0 0
1 2 0 0 0 0 0
1 2 3 4 5 6 7

인용 양식

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

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

Community Treasure Hunt

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

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

modernised, add image

1.0.0.0

version 1.1 (may 2006) corrected small error in help text (thank to MF)