MATLAB: Does the DATENUM function crash in MATLAB 7.0.4 (R14SP2) when called with an empty argument

argumentsdatenumemptyMATLABsegmentationviolation

When I execute the following code:
datenum({[]}, 'yyyy-mm-dd')
I receive a segmentation violation with the following stack trace:
[0] dtstr2dtnummx.dll:_mexFunction(1, 0x00cddf9c, 2, 0x00cddffc) + 288 bytes
[1] libmex.dll:_mexRunMexFile(1, 0x00cddf9c, 2, 0x00cddffc) + 103 bytes
[2] libmex.dll:public: virtual void __thiscall Mfh_mex::dispatch_file(int,struct mxArray_tag * *,int,struct mxArray_tag * *)(1, 0x00cddf9c, 2, 0x00cddffc) + 157 bytes
[3] m_dispatcher.dll:public: virtual void __thiscall Mfh_file::dispatch_fh(int,struct mxArray_tag * *,int,struct mxArray_tag * *)(1, 0x00cddf9c, 2, 0x00cddffc) + 271 bytes
[4] m_interpreter.dll:int __cdecl mdDispatch(int,char const *,int,struct mxArray_tag * *,int,struct mxArray_tag * *,class Mfh_MATLAB_fn * *)(476, 0x0e9d25b0 "dtstr2dtnummx", 1, 0x00cddf9c) + 88 bytes
[5] m_interpreter.dll:_inDispatchFromStack(476, 0x0e9d25b0 "dtstr2dtnummx", 1, 2) + 801 bytes

Best Answer

This bug has been fixed in Release 14 Service Pack 3 (R14SP3). For previous product releases there are no workarounds.