mxArray.class_id() can not handle custom class definitions
The function class_id()
on the mxArray type panics when matlab reports a class ID that does not belong to the ClassID enum.
However this can easily happen, as custom classes defined via classdef get their own ID numbers. See https://de.mathworks.com/help/matlab/apiref/mxgetclassid.html:
For a list of C-language class identifiers, see the mxClassID function. For user-defined types, mxGetClassId returns a unique value identifying the class of the array contents.
This makes the function basically unusable, as it can easily panic.
Maybe extend the ClassID enum with an extra catch all entry Custom
that carries this unique ID?