1

I have a table which looks like this:

Entry number Timestamp Value1 Value2 Value3 Value4
5758 28-06-2018 16:30 34 63 34.2 60.9
5759 28-06-2018 17:00 33.5 58 34.9 58.4
5758 28-06-2018 16:30 34 63 34.2 60.9
5759 28-06-2018 17:00 33.5 58 34.9 58.4
5760 28-06-2018 17:30 33 53 35.2 58.5
5761 28-06-2018 18:00 33 63 35 57.9
5762 28-06-2018 18:30 33 61 34.6 58.9
5763 28-06-2018 19:00 33 59 34.1 59.4
5764 28-06-2018 19:30 28 89 33.5 64.2
5765 28-06-2018 20:00 28 89 33 66.1
5766 28-06-2018 20:30 28 83 32.5 67
5767 28-06-2018 21:00 29 89 32.2 68.4

Where '28-06-2018 16:30' is under one column. So I have 6 columns:

Entry number, Timestamp, Value1, Value2, Value3, Value4

I want to extract all rows that belong to '28-06-2018', i.e all data pertaining to that day. Since my table is too large I couldn't fit more data, however, the entries under the timestamp range for a couple of months.

1
  • It would be nice to add the table in a minimal working example so people can provide answers faster. Commented Nov 14, 2021 at 9:26

1 Answer 1

1
t=table([5758;5759],["28-06-2018 16:30";"29-06-2018 16:30"],[34;33.5],'VariableNames',{'Entry number','Timestamp','Value1'})

t =

2×3 table

Entry number        Timestamp         Value1
____________    __________________    ______

    5758        "28-06-2018 16:30"       34 
    5759        "29-06-2018 16:30"     33.5
t(contains(t.('Timestamp'),"28-06"),:)

ans =

1×3 table

Entry number        Timestamp         Value1
____________    __________________    ______

    5758        "28-06-2018 16:30"      34
Sign up to request clarification or add additional context in comments.

2 Comments

all the values of 28-06-2018 should show up..not just 1
all the values of 28-06-2018 indeed showed up. The other line is specifically marked "29-06-2018" to show the difference.

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.