Colon operation for numerical string(s)/Print page selection

버전 1.1.0.0 (3.78 KB) 작성자: Yung-Yeh Chang
Parse numerical strings/string with delimiter to a concatenated numerical vector
다운로드 수: 96
업데이트 날짜: 2015/4/15

라이선스 보기

Parse numerical strings cell array or string with delimiter to a concatenated numerical vector with equal space for each numerical range. What it does is basically the colon operation for strings with concatenation. It is useful for GUI design as per user input or converting data from text file input. All the COLON operation rules apply to this function.
Examples:
numstr2range('1-10') % The output is equivalent to 1:10
numstr2range('1-5,7,9-10') % The output is equivalent to [1:5,7,9:10]. Very much like the print page selection.
numstr2range('1-10','space',0.1) % The output is equivalent to 1:0.1:10
numstr2range('1-10,11-20','space',0.1) % The output is equivalent to [1:0.1:10 11:0.1:20]
numstr2range({'1-10','101-110','50-51,80'},'space',0.1); % The output is equivalent to [1:0.1:10 101:0.1:110 50:0.1:51 80];
numstr2range('1-10,8-12,15-16','space',0.1); % The output is equivalent to [1:0.1:10 8:0.1:12 15:0.1:16];
numstr2range('1-10,8-12,15-16','duplicated',false); % The output is equivalent to unique([1:10 8:12 15:16]);
numstr2range('2-5,1-4','sortoption','descend') % The output is equivalent to sort([2:5 1:4],'descend')

인용 양식

Yung-Yeh Chang (2024). Colon operation for numerical string(s)/Print page selection (https://www.mathworks.com/matlabcentral/fileexchange/50504-colon-operation-for-numerical-string-s-print-page-selection), MATLAB Central File Exchange. 검색됨 .

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

Community Treasure Hunt

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

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

Update description.

1.0.0.0