Determine if Java feature is available
Use the following code snippet to test that
the AWT GUI components are available before attempting to display
a Java Frame. If the AWT is not available on your system, MATLAB® displays
Unable to open a Java Frame.
if usejava('awt') myFrame = java.awt.Frame; else disp('Unable to open a Java Frame') end
Use the following code snippet to terminate a script if MATLAB does not have access to JVM™ software.
filename, is a function
that contains Java code.
if ~usejava('jvm') error([filename ' requires Java to run.']) end