Extracting time valued between lower and upper bound
Show older comments
Hi Everyone,
I am trying to extract all the rows corresponding to lower and upper bound times. I have a big table (28125x31) and minimum and maximum times in table are 06:13:19 AM and 06:26:37 AM, respectively. I want to get data between t_min and t_max, whereas t_min = 06:16:44 AM and t_max = 06:17:05 AM. I am using following code
row = a([isbetween(a.time(:),t_min,t_max)],:);
where, a is table (28125x31), a.time is vector containing times as shown in attached excel sheet, t_min & t_max are described previously. While this bit of code, I am getting row table as 21871x31. When I check min and max time in row.time, they are 06:16:45 AM and 06:26:37 AM. The upper bound in row.time should be equal to 06:17:05 AM, but somehow code is giving me this value, which leads to inapporporaite size of table.
I have attached a .mat file (Data), containing a table file, which is named as "a".
Any help in figuring out the issue and how to get around it would be highly appreciated. Thank you.
1 Comment
dpb
on 13 Sep 2022
You forgot to show us the code definitions for t_min, t_max...
Accepted Answer
More Answers (0)
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!