split
calendarDuration형을 숫자 단위와 기간 단위로 분할
설명
예제
calendarDuration형 배열 분할하기
calendarDuration
형 배열을 만듭니다.
T = calmonths(15:17) + caldays(8) + hours(1.2345)
T = 1x3 calendarDuration
1y 3mo 8d 1h 14m 4.2s 1y 4mo 8d 1h 14m 4.2s 1y 5mo 8d 1h 14m 4.2s
월, 일, 시간 값을 가져옵니다.
[m,d,t] = split(T,{'months','days','time'})
m = 1×3
15 16 17
d = 1×3
8 8 8
t = 1x3 duration
01:14:04 01:14:04 01:14:04
연, 월, 일, 시간 값을 가져옵니다.
[y,m,d,t] = split(T,{'years','months','days','time'})
y = 1×3
1 1 1
m = 1×3
3 4 5
d = 1×3
8 8 8
t = 1x3 duration
01:14:04 01:14:04 01:14:04
연과 월을 모두 요청하면 split
은 12보다 큰 월 값을 연 값으로 넘깁니다.
입력 인수
t
— 입력 calendarDuration형
calendarDuration
형 배열
입력 calendarDuration형으로, calendarDuration
형 배열로 지정됩니다.
데이터형: calendarDuration
units
— 날짜와 시간 단위
문자형 벡터 | 문자형 벡터로 구성된 셀형 배열 | string형 배열
날짜와 시간 단위로, 문자형 벡터, 문자형 벡터로 구성된 셀형 배열 또는 string형 배열로 지정됩니다. 첫 번째 인수가 calendarDuration
형 배열, t
일 때만 units
를 지정하십시오.
단위는 다음 표에 있는 값 중 하나 이상일 수 있습니다.
값 | t 의 분할 단위 |
---|---|
'years' | 연 |
'quarters' | 사분기 |
'months' | 월 |
'weeks' | 주 |
'days' | 일 |
'time' | 시간으로, 시간:분:초 형식입니다. |
가장 큰 단위부터 가장 작은 단위로의 순서로 날짜와 시간 단위를 지정해야 합니다. 예를 들어, {'years','months'}
는 유효하지만, {'months','years'}
는 유효하지 않습니다.
예: split(t,{'years','months','days'})
데이터형: char
| cell
| string
출력 인수
X1,X2,...
— 출력 숫자 및 duration
값
배열
출력 숫자형과 duration
형 값으로, 배열로 반환됩니다. split
은 연, 월, 일 값을 숫자형 배열로 반환하고 duration
배열에는 시간 값을 반환합니다.
데이터형: double
| duration
확장 기능
tall형 배열
메모리에 담을 수 없을 정도로 많은 행을 가진 배열을 계산할 수 있습니다.
이 함수는 tall형 배열을 완전히 지원합니다. 자세한 내용은 tall형 배열 항목을 참조하십시오.
스레드 기반 환경
MATLAB®의 backgroundPool
을 사용해 백그라운드에서 코드를 실행하거나 Parallel Computing Toolbox™의 ThreadPool
을 사용해 코드 실행 속도를 높일 수 있습니다.
버전 내역
R2014b에 개발됨
MATLAB 명령
다음 MATLAB 명령에 해당하는 링크를 클릭했습니다.
명령을 실행하려면 MATLAB 명령 창에 입력하십시오. 웹 브라우저는 MATLAB 명령을 지원하지 않습니다.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)