Converting data at the current time when building in Matlab

I am doing a simple plot in matlab from windspeed versus time. I converted the time using the data center function and was able to make this graph. However, is there a way to convert the data outputs to a date format when plotting?

+4
source share
2 answers

You can use the datetick function. It converts the serial numbers into a human-readable date.

0
source

I'm not sure when it was added, but now you can use the datetime format in the plot command:

taken from MATLAB docs (see also here ):

 t = 0:seconds(30):minutes(3); y = rand(1,7); plot(t,y,'DurationTickFormat','mm:ss') 

will generate (something like this):

Datetime plot

0
source

Source: https://habr.com/ru/post/1434474/


All Articles