필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Determine whether a column in a Table contains time data

조회 수: 2 (최근 30일)
Aniruddha
Aniruddha 2017년 2월 2일
마감: MATLAB Answer Bot 2021년 8월 20일
How can I determine whether a column in a Table is a time vector? In addition, how can I ensure that all rows in this column have the same time series format?

답변 (1개)

Iddo Weiner
Iddo Weiner 2017년 2월 2일
Please define "time vector" - do you mean that the numbers should simply be monotonically increasing? or do you also have a certain "time format" / "time pattern" you're looking for ? If it's the first option, the solution is simple enough:
function out = is_monotonically_increasing(vector)
if sum (vector(2:end) - vector(1:end-1) <= 0) > 0
Out = 0;
else
Out = 1;
end
end
If you need something more specific please describe more thoroughly
  댓글 수: 3
Iddo Weiner
Iddo Weiner 2017년 2월 4일
Absolutely! Aniruddha - are you there? does this help? Or do you have different specifications?

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by