change datetime data to just a number in matlab

You can use datenum() function in MATLAB which converts datetime to a serial datenumber. The datenumber represents number of days since January 0, 0000.

Here is an example:

main.m
datetime_data = datetime;
date_number = datenum(datetime_data);
64 chars
3 lines

In the above code, datetime_data is the datetime variable that needs to be converted and date_number is the converted numerical value.

related categories

gistlibby LogSnag