Plotting dates on the x-axis
조회 수: 2 (최근 30일)
이전 댓글 표시
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!!
댓글 수: 0
답변 (1개)
darova
2021년 4월 6일
Just use datenum
a = rand(5,4,3);
datenum(a(:,1),a(:,2),a(:,3))
Use sort if needed
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Dates and Time에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!