I have separate column vectors of dd, mm, yyyy, HH and MM, how do I combine them into the format dd-mm-yyyy HH:MM to plot on the x axis

2 visualizaciones (últimos 30 días)
I have the variables day, month, year, hour and minute - all column vectors.
How do I combine these into the dd-mm-yyyy HH:MM format so I can plot this on the x-axis of a graph?

Respuestas (1)

KSSV
KSSV el 4 de Nov. de 2020
  1 comentario
Stephen23
Stephen23 el 24 de Jun. de 2024
For example:
Xye = [2023;2024;2024];
Xmo = [12;01;01];
Xda = [31;01;03];
Xho = [02;23;07];
Xmi = [59;01;23];
D = datetime(Xye,Xmo,Xda,Xho,Xmi,0)
D = 3x1 datetime array
31-Dec-2023 02:59:00 01-Jan-2024 23:01:00 03-Jan-2024 07:23:00
plot(D,rand(size(D)))

Iniciar sesión para comentar.

Categorías

Más información sobre Calendar 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