필터 지우기
필터 지우기

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

조회 수: 1 (최근 30일)
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?

답변 (1개)

KSSV
KSSV 2020년 11월 4일
  댓글 수: 1
Stephen23
Stephen23 2024년 6월 24일
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)))

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Axes Appearance에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by