Plot datetime range from table

12 visualizaciones (últimos 30 días)
John Doe
John Doe el 3 de Jun. de 2019
Respondida: Steven Lord el 3 de Jun. de 2019
Hello,
I have some data in a table with a datetime column in the format 'DD-MMM-YYYY HH:MM:SS'. Usually I would just use row numbers for plotting different time ranges.
Can I use xlim to plot between a specific date range. I would like to call the data range specifically not the row / column number.
i.e for table 't'
plot(t.Time,t.SomeData)
xlim([])
Time SomeData 1 Some Data 2
'13-May-2019 00:00:00' 1557720000.00000 1361.30000000000
'13-May-2019 00:00:01' 1557720001.00000 1363.20000000000
'13-May-2019 00:00:02' 1557720002.00000 1358.10000000000
'13-May-2019 00:00:03' 1557720003.00000 1356

Respuesta aceptada

John Doe
John Doe el 3 de Jun. de 2019
I've answered my own question:
plot(t.Time,t,SomeData1)
tStart = datetime(2019,5,13,HH,MM,SS)
tEnd = datetime(2019,5,13,HH,MM,SS)
xlim([tStart tEnd])

Más respuestas (1)

Steven Lord
Steven Lord el 3 de Jun. de 2019
If you stored your data in a timetable you could use the timerange function to select only rows of your timetable whose RowTimes are in a certain interval. You could convert your table into a timetable using the table2timetable function.

Categorías

Más información sobre Tables en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by