Selecting rows related with specfic measurement time

5 views (last 30 days)
I have data from a sensor, data were recording for five days non stop. How to select specific rows, related with the certain time, e.g. 11-09-2013 11:20:00 - 11:21:49 PM ? Then, how to divide the obtained data into equal segments 2.56 seconds each? Help me please

Answers (2)

Image Analyst
Image Analyst on 20 Nov 2013
Hint: Use datenum():
>> datenum('11-09-2013 11:20:00')
ans =
735547.472222222
  1 Comment
swinnn
swinnn on 20 Nov 2013
I have tried datenum,
start= datenum('11-09-2013 11:20:00 PM'); stop = datenum ('11-09-2013 11:21:49 PM')
but when i do : x=find(data >= start & data <= stop);
i get empty matrix..

Sign in to comment.


Azzi Abdelmalek
Azzi Abdelmalek on 20 Nov 2013
Edited: Azzi Abdelmalek on 20 Nov 2013
You need to specify the format of your date
datenum('11-09-2013 11:20:00 PM','dd-mm-yyyy HH:MM:SS AM')
  5 Comments
Azzi Abdelmalek
Azzi Abdelmalek on 20 Nov 2013
Check your data
celldisp(arrayfun(@(x) datestr(x, 'dd-mm-yyyy HH:MM:SS AM'),data*86400,'un',0))
swinnn
swinnn on 21 Nov 2013
??? Error using ==> dateformverify at 28 DATESTR failed converting date number to date vector.
Error in ==> datestr at 197 S = dateformverify(dtnumber, dateformstr, islocal);
Error in ==> @(x)datestr(x,'dd-mm-yyyy HH:MM:SS AM')
Caused by: Error using ==> datevecmx Date number out of range.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!