enum: a pedestrian enumerator

버전 1.0.0.0 (1.94 KB) 작성자: us
To create an enumerating vector from a list of terminators.
다운로드 수: 4K
업데이트 날짜: 2005/5/5

라이선스 보기

ENUM creates an enumerating vector from a list of terminators N(1:n)

E = [ 1:N(1) 1:N(2) ... 1:N(x) ... 1:N(n) ]

non-integer (non-enumerable) terminators such as <inf>s or <nan>s are handled by an option

EXAMPLES
n=[nan 2 inf 3 0 0 1 3 nan]
e=enum(n)
% e = 1 2 1 2 3 1 1 2 3

e=enum(n,'-')
% e = NaN 1 2 Inf 1 2 3 0 0 1 1 2 3 NaN

e=enum(n,-100)
% e = -100 1 2 -100 1 2 3 -100 -100 1 1 2 3 -100

NOTE
this function is based on a smart snippet provided
by long-time CSSMer <STEVE AMPHLETT> in the thread
'Replicating Rows based on an Index in the Matrix'
(2005-05-01 05:18:30 EST)

see
help enum
for more explanations

인용 양식

us (2024). enum: a pedestrian enumerator (https://www.mathworks.com/matlabcentral/fileexchange/7590-enum-a-pedestrian-enumerator), MATLAB Central File Exchange. 검색됨 .

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

Community Treasure Hunt

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

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

added an important input check; added screenshot; ver tag 04-May-2005 21:36:36