This is a static copy of a profile reportHome
usejava (40 calls, 0.011 sec)
Generated 05-Aug-2011 13:03:36 using cpu time.
function in file /usr/local/MATLAB/R2011a/toolbox/matlab/general/usejava.m
Copy to new window for comparing multiple runs
Parents (calling functions)
Lines where the most time was spent
Line Number | Code | Calls | Total Time | % Time | Time Plot |
44 | if nargin < 1 | 40 | 0.011 s | 100.0% |  |
47 | isok = system_dependent('useJa... | 40 | 0 s | 0% |  |
All other lines | | | 0 s | 0% |  |
Totals | | | 0.011 s | 100% | |
Children (called functions)
No childrenCode Analyzer results
No Code Analyzer messages.Coverage results
[ Show coverage for parent directory ]
Total lines in function | 47 |
Non-code lines (comments, blank lines) | 43 |
Code lines (lines that can run) | 4 |
Code lines that did run | 2 |
Code lines that did not run | 2 |
Coverage (did run/can run) | 50.00 % |
Function listing
time calls line
1 function isok = usejava(feature)
2 %USEJAVA True if the specified Java feature is supported in MATLAB.
3 % USEJAVA(LEVEL) returns 1 if the feature is supported and
4 % 0 otherwise.
5 %
6 % The following levels of support exist:
7 %
8 % LEVEL MEANING
9 % -----------------------------------------------------
10 % 'jvm' The Java Virtual Machine is running.
11 % 'awt' AWT components are available.
12 % 'swing' Swing components are available.
13 % 'desktop' The MATLAB interactive desktop is running.
14 %
15 % "AWT components" refers to Java's GUI components in the Abstract
16 % Window Toolkit. "Swing components" refers to Java's lightweight
17 % GUI components in the Java Foundation Classes.
18 %
19 % EXAMPLES:
20 %
21 % If you want to write a MATLAB program that displays a Java Frame and want
22 % to be robust to the case when there is no display set or no JVM
23 % available, you can do the following:
24 %
25 % if usejava('awt')
26 % myFrame = java.awt.Frame;
27 % else
28 % disp('Unable to open a Java Frame.');
29 % end
30 %
31 % If you want to write a MATLAB program that uses Java code and want it to
32 % fail gracefully when run in a MATLAB session that does not have access
33 % to a JVM, you can add the following check:
34 %
35 % if ~usejava('jvm')
36 % error([mfilename ' requires Java to run.']);
37 % end
38 %
39 % See also JAVACHK
40
41 % Copyright 1984-2010 The MathWorks, Inc.
42 % $Revision: 1.6.4.4 $ $Date: 2010/06/15 01:38:44 $
43
0.01 40 44 if nargin < 1
45 error(nargchk(1,1,nargin,'struct'));
46 end
40 47 isok = system_dependent('useJava',feature);