ParaMonte MATLAB 3.0.0
Parallel Monte Carlo and Machine Learning Library
See the latest version documentation.
isgui.m
Go to the documentation of this file.
1%> \brief
2%> Return a scalar MATLAB logical ``true`` if and only if the
3%> current environment is the MATLAB Graphical User Interface (GUI),
4%> otherwise, return ``false`` implying that MATLAB engine is active
5%> without the GUI (e.g., called from the system shell command line).
6%>
7%> \details
8%> This functionality is important for certain
9%> library features that require MATLAB GUI.
10%>
11%> \warning
12%> This function relies on functionalities
13%> that are supported only in MATLAB ``> 2019a``.
14%>
15%> \return
16%> ``itis`` : The output scalar MATLAB logical that is ``true``
17%> if and only if ParaMonte MATLAB library is being called
18%> from MATLAB Graphical User Interface (GUI), otherwise, ``false``.
19%>
20%> \interface{isgui}
21%> \code{.m}
22%>
23%> itis = pm.matlab.isgui()
24%>
25%> \endcode
26%>
27%> \example{isgui}
28%> \include{lineno} example/matlab/isgui/main.m
29%> \output{isgui}
30%> \include{lineno} example/matlab/isgui/main.out.m
31%>
32%> \final{isgui}
33%>
34%> \author
35%> \JoshuaOsborne, May 21 2024, 11:39 PM, University of Texas at Arlington<br>
36%> \FatemehBagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.<br>
37%> \AmirShahmoradi, May 16 2016, 9:03 AM, Oden Institute for Computational Engineering and Sciences (ICES), UT Austin<br>
38function itis = isgui()
39 persistent itis_persistent
40 if isempty(itis_persistent)
41 try
42 % usejava() is sensitive to char vs. string input arguments. always input char.
43 itis_persistent = usejava('desktop') && feature('ShowFigureWindows') && ~batchStartupOptionUsed; % batchStartupOptionUsed is introduced in R2019a and not supported in older versions of MATLAB
44 catch
45 itis_persistent = usejava('desktop') && feature('ShowFigureWindows');
46 end
47 end
48 itis = itis_persistent;
49end
function isgui()
Return a scalar MATLAB logical true if and only if the current environment is the MATLAB Graphical Us...