How to convert data points to time
조회 수: 11 (최근 30일)
이전 댓글 표시
Hi, so I have this data and I want to convert the x-axis to time. Right now the x-axis represents the data point. Please help.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/467765/image.png)
댓글 수: 0
채택된 답변
Steven Lord
2020년 12월 22일
Make a datetime or duration array and call plot with that as the first data input.
v = 1:10;
x = datetime('today')+days(v);
y = v.^2;
plot(x, y)
t = hours(v);
plot(t, y)
댓글 수: 0
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!