Plotting dates on the x-axis

2 visualizaciones (últimos 30 días)
Luiz Aguiar
Luiz Aguiar el 4 de Abr. de 2021
Respondida: darova el 6 de Abr. de 2021
I have a cell with 4 columns in which the first one is a day, the second is a month, the third is a year and the fourth is an index value. I would like to know if there's a way of plotting a "timelapse" on the x-axis using the info in the first three columns and the index values on the y-axis, or do I have to modify my cell using datenum? If so, any tips on doing that? Thanks in advance, any help is very valuable!!

Respuestas (1)

darova
darova el 6 de Abr. de 2021
Just use datenum
a = rand(5,4,3);
datenum(a(:,1),a(:,2),a(:,3))
ans = 5×1
55.5745 351.6499 41.5854 342.2935 116.0815
Use sort if needed

Categorías

Más información sobre Dates and Time en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by