CalendarDuration with a number (double)
이전 댓글 표시
Dear All
I am trying to compare calendarDuration with a number. For e.g. I have an array with time in the format "dd-MMM-yy hh:mm:ss.SSS". I need to find the difference between them by looping through them only if the time is greater than 0.5s (500ms). It is important to note than the values are within a few (milli)seconds between each other i.e. multiple values are generated every minute/second thereby rendering 'dd-MMM-yy hh:' useless.
Example:
if dd-MMM-yy hh:mm:ss.SSS(x,1) - dd-MMM-yy hh:mm:ss.SSS(x-1,1) > 0.5 [ i.e. Row 2 - Row 1 > 0.5]
then store the value in an array (diffArray)
else store 0 and compute if dd-MMM-yy hh:mm:ss.SSS(x+1,1) - dd-MMM-yy hh:mm:ss.SSS(x-1,1) > 0.5 [i.e.Row 3 - Row 1 > 0.5]
then store the value in diffArray
else store 0 and go to the subsequent row [i.e. Row4 - Row1 > 0.5]
The idea is to store differences between rows which are greater than 0.5s (else store 0). The next value greater than 0.5 could be in the next row or some row after the next and so on...
The problem is that I cant use '>' for calendarDuration. I get the error "Undefined operator '>' for input arguments of type 'calendarDuration'."
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Whos에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!