Create matrix based off date

Hello,
I have a vector that I want to convert into a matrix based off date. I have one column (X) with date/time (yyyy-MM-dd HH:mm:ss) and a second column (Y) with my data. The data was taken every 30 min for 4 years. I want to create a matrix from my data (column Y) in which each row has data from one day. I have no clue where to begin, any help is greatly appreciated.
Thanks!

Respuestas (1)

Walter Roberson
Walter Roberson el 22 de Mayo de 2018

0 votos

Convert to a timetable() object and use retime()

5 comentarios

Walter Roberson
Walter Roberson el 22 de Mayo de 2018
Oh wait -- is the question about finding max/min/average for the day, or is it about re-arranging the data so that all of the data for one day is in one row?
Devon Fisher-Chavez
Devon Fisher-Chavez el 22 de Mayo de 2018
I’m just asking about rearranging the data so that data for one day is in one row. Thanks!
Provided that the data has full days:
reshape(YourData, 48, []).'
Devon Fisher-Chavez
Devon Fisher-Chavez el 23 de Mayo de 2018
Thank you.
Our data is imperfect, however. There are a lot of missing points, filtered points, etc. so I would prefer a method that directly tests the time of day.
Devon Fisher-Chavez
Devon Fisher-Chavez el 23 de Mayo de 2018
actually, that works perfectly. the data is filled, plus I'd need filled data to make a matrix anyways... don't know what I was thinking. Thanks!

La pregunta está cerrada.

Preguntada:

el 22 de Mayo de 2018

Cerrada:

el 20 de Ag. de 2021

Community Treasure Hunt

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

Start Hunting!

Translated by