User`s guide
Language and Programming
2-5
Language and Programming
datetime, duration, and calendarDuration arrays for efficient
computation, comparison, and formatted display of dates and times
datetime, duration and calendarDuration are new data types for representing
dates and times. You can manipulate arrays of these types in the same way that
you work with numeric arrays. For example, you can add, subtract, sort, compare,
concatenate, and plot date and time values.
The new data types support the following features:
• Functions for both calendar computations and fixed-length time computations on
absolute dates and times, and elapsed times
• TimeZone property for setting and converting datetime time zone, accounting for
daylight saving time
• Customizable default display format for dates
• Nanosecond precision for absolute times
• Import of data as datetime arrays using the Import Tool and the readtable and
textscan functions
For more information, see Dates and Time.
Compatibility Considerations
When importing data from spreadsheets or text files using the Import Tool, there is no
longer an option to convert dates to numeric serial date numbers. Instead, import the
data into a table or as column vectors, and specify the datetime data type for each
column of dates.
Suggested corrections for syntax errors in the Command Window
MATLAB suggests corrections for function names mistyped in the Command Window.
This functionality now includes suggestions for:
• Missing closing parentheses or brackets such as ), ], and } in function calls and
arrays