ParaMonte MATLAB 3.0.0
Parallel Monte Carlo and Machine Learning Library
See the latest version documentation.
version.m
Go to the documentation of this file.
1%> \brief
2%> Return a scalar MATLAB string containing the latest
3%> available ParaMonte MATLAB version newer than the
4%> existing version on the current system.
5%>
6%> \param[in] silent : The input scalar MATLAB logical.<br>
7%> If ``true``, all descriptive messages on
8%> the MATLAB command line will be suppressed.<br>
9%> (**optional**, default = ``false``)
10%>
11%> \return
12%> ``str`` : The output scalar MATLAB string containing the
13%> latest available ParaMonte MATLAB version newer
14%> than the existing version on the current system.<br>
15%> The output ``str`` will be set to empty string ``""``
16%> if there is no newer version or the function fails.<br>
17%>
18%> \interface{version}
19%> \code{.m}
20%>
21%> str = pm.lib.update.version()
22%> str = pm.lib.update.version(silent)
23%>
24%> \endcode
25%>
26%> \example{version}
27%> \include{lineno} example/lib/update/version/main.m
28%> \output{version}
29%> \include{lineno} example/lib/update/version/main.out.m
30%>
31%> \final{version}
32%>
33%> \author
34%> \JoshuaOsborne, May 21 2024, 7:57 PM, University of Texas at Arlington<br>
35%> \FatemehBagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.<br>
36%> \AmirShahmoradi, May 16 2016, 9:03 AM, Oden Institute for Computational Engineering and Sciences (ICES), UT Austin<br>
37function str = version(silent)
38 if nargin < 1
39 silent = [];
40 end
41 if isempty(silent)
42 silent = false;
43 end
44 versionLink = "https://raw.githubusercontent.com/cdslaborg/paramonte/main/src/matlab/VERSION.md";
45 try
46 versionFileLineList = strsplit(webread(versionLink), newline);
47 str = string(versionFileLineList{1});
48 catch me
49 str = "";
50 if ~silent
51 weblinks = pm.lib.weblinks();
52 warning ( newline ...
53 + string(me.identifier) + " : " + string(me.message) + newline ...
54 + "Failed to fetch the latest version number from the weblink:" + newline ...
55 + newline ...
56 + pm.io.tab + pm.web.href(versionLink) + newline ...
57 + newline ...
58 + "Ensure MATLAB has access to the internet." + newline ...
59 + "Otherwise, the structure of the ParaMonte library project on GitHub might have changed." + newline ...
60 + "The current ParaMonte library on your system is " + pm.lib.version() + newline ...
61 + "You can check for any newer package releases on the ParaMonte GitHub repository release page:" + newline ...
62 + newline ...
63 + pm.io.tab + pm.web.href(weblinks.github.releases.url) + newline ...
64 + newline ...
65 );
66 end
67 end
68end
function version(in silent)
Return a scalar MATLAB string containing the latest available ParaMonte MATLAB version newer than the...
function lib()
Return a scalar MATLAB string containing the path to the lib directory of the ParaMonte library packa...