Matlab arguments validation

Matlab arguments validation syntax is generally recommended over the legacy validateattributes. The arguments specification coerces the data to fix the class declaration given if possible, and errors otherwise.

  • Default values are easily specified, which required such verbose syntax before.
  • only a single class can be specified
  • recall the .empty method of most Matlab classes e.g. datetime.empty() that allows initializing an empty array.

Note: the Matlab argument validation syntax coerces class at runtime.