Time index

버전 1.2.0.1 (2.31 KB) 작성자: Robert Bemis
TIMEIDX returns numeric index given time string
다운로드 수: 2.4K
업데이트 날짜: 2016/9/1

라이선스 보기

>> help timeidx
TIMEIDX returns numeric index given time string.
D = TIMEIDX(T) returns index value in relative days which is suitable for
DATENUM math. To work in hours multiply by 24, for seconds multiply
by 24*3600, etc. T can be a time string (DD:HH:MM:SS) where DD, HH
and MM are incrementally optional and SS can include a decimal
fraction. For multiple time values T must be a cell array of strings.
The result is the same size/shape but type DOUBLE.

D = TIMEIDX(T1,T2) returns a range of values. T1 and T2 are individual
time strings (as above) and the result is a 1x2 DOUBLE array.

N = TIMEIDX(...,FS) instead returns index values in sample units relative
to the beginning of a record where FS is samples/second. Sample
values are rounded to integer values. Time 0 corresponds to sample 1.

Example 1: operation times out after 5 minutes
t2 = now+timeidx('5:00')*24*3600;
while ~done && now<t2
%wait for something else to happen
end
if ~done
error('Operation failed to complete in 5 minutes')
end

Example 2: specify portion of WAV file to read
range = timeidx('2.5','1:02.5',Fs); %1 minute after 2.5 second delay
x = wavread('myfile.wav',range);

See also DATENUM, DATESTR

인용 양식

Robert Bemis (2024). Time index (https://www.mathworks.com/matlabcentral/fileexchange/21891-time-index), MATLAB Central File Exchange. 검색됨 .

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

Community Treasure Hunt

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

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

Updated license

1.2.0.0

copyright

1.0.0.0