
Undocumented Secrets of MATLAB
®
-Java Programming94
separately test the major version number (7) and the minor number, as has been done in the
code snippet above.
30
Recent MATLAB releases have added the verlessThan built-in function that does this
for us, but unfortunately verLessThan did not exist in earlier releases and so code relying
on this function would not work on these releases. Using the code snippet above solves this
problem for all MATLAB 7 releases (earlier releases did not have the regexprep function,
but this can easily be xed by other means).
Note that we cannot simply call javaObjectEDT within a try-catch block, since MATLAB ...