1

I'm applying tall arrays to a couple of .csv files. The tall array looks like:

  Timestamp           wind_spd_sd    wind_spd_mx
___________________    ___________    ___________

04/03/2016 00:00:01    0.57576        4.1        
04/03/2016 00:03:01    0.53692        3.1        
04/03/2016 00:06:01    0.35642        4.2        
04/03/2016 00:09:01    0.63012        4.9        
04/03/2017 00:12:01    0.30357        3.7        
04/03/2017 00:15:01    0.53442        10        
:                      :              :
:                      :              :

I want to be able to select the rows of data between specific dates and times. I came across "timerange" which is used for timetables and used it as:

S1 = timerange('01/01/2015 08:00:00','12/18/2016 12:00:00')

S2 = tt{S1,:}

but had the error: "Subscripting using TIMERANGE is only supported for selecting rows of a timetable."

I then tried using datenum as:

t_start = datenum('04/03/2014 00:00:01', 'dd/MM/yyyy HH:mm:ss');

t_end = datenum('04/03/2015 00:03:01', 'dd/MM/yyyy HH:mm:ss');

rows = find(tt.Timestamp>t_start) 

and the error was: "Undefined function 'find' for input arguments of type 'tall'"

I'm not 100% sure if the problem is definitely tall arrays or that I'm making a mistake in how I use these functions. Is there a way to do what I'm trying to achieve here with tall array?

1
  • If the posted answer solves your problem, consider marking it accepted by clicking , on the left side of the answer, to turn it green so that the community may know that your problem is solved. Commented May 15, 2017 at 17:24

1 Answer 1

2

You were on the right track with your use of the timerange function. However, you need to convert your tall array to a timetable, which is a specific data type. Do this first:

TT = table2timetable(tt);
S1 = timerange('01/01/2015 08:00:00','12/18/2016 12:00:00')
S2 = TT(S1,:);
Sign up to request clarification or add additional context in comments.

1 Comment

Thank you. Very helpful.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.