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'."

 채택된 답변

madhan ravi
madhan ravi 2019년 5월 27일

1 개 추천

Datas=seconds(array-array(1)); % array in format "dd-MMM-yy hh:mm:ss.SSS"
Now use Datas for comparison.

추가 답변 (0개)

카테고리

제품

질문:

2019년 5월 27일

답변:

2019년 5월 27일

Community Treasure Hunt

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

Start Hunting!

Translated by