How do you convert DateTime Strings into Date and Time values (seconds or month,day,time) Trying to plot wind speed by time
이전 댓글 표시
I am trying to plot wind speed (y-axis) by time (x-axis), however, the file that I was given has the time values stored as datetime strings and I am trying to convert these to time in seconds or the format of mm,dd, HH:MM:SS. Please help me!
답변 (1개)
Peter Perkins
2022년 3월 14일
0 개 추천
Cam, what problem are you having. Your screenshot suggests you have a vector of datetimes. Use that in plot, or whatever charting command you are using. If you want the tick labels to have some particular form, change the time1.Format property. It looks like you might want that to be "MM,dd HH:mm:ss". Or maybe MMM.
댓글 수: 4
Cam Pine
2022년 3월 14일
Peter Perkins
2022년 3월 14일
doc datetime, but
time1.Format = "MM,dd HH:mm:ss"
Cam Pine
2022년 3월 14일
Peter Perkins
2022년 3월 15일
I think you want to look at the doc for plot. wavg doesn't even appear in your screen shots, so I have no idea what it is, but if you want to make a plot against time, then time should be the first input to plot.
카테고리
도움말 센터 및 File Exchange에서 Printing and Saving에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!