MATLAB: Does MATLAB Coder support DATEVEC, DATENUM, DATESTR, DATETIME, and other date-related functions

matlab codertictoc

Does MATLAB Coder support DATEVEC, DATENUM, DATESTR, DATETIME, and other date-related functions?

Best Answer

At this time, support for date-related functions is not available in MATLAB Coder.
The limitation on date related functions is due to the variety of ways different operating systems and deployment targets handle system time. For many embedded targets, there is no such concept of a "system time" like there is with desktop operating systems.
Calculating system time may possible, depending on the platform, by calling external C code from within the MATLAB code. Please refer to the following link:
<https://www.mathworks.com/matlabcentral/answers/95744-how-can-i-calculate-the-system-time-using-custom-code-in-matlab-coder-2-0-r2011a>