ParaMonte MATLAB 3.0.0
Parallel Monte Carlo and Machine Learning Library
See the latest version documentation.
split2real.m
Go to the documentation of this file.
1%> \brief
2%> Return a vector of real values by splitting the
3%> input ``str`` string by the specified input ``sep``.<br>
4%>
5%> \details
6%> This function is primarily used for splitting a
7%> string into a double vector of real numbers.<br>
8%>
9%> \param[in] str : The input scalar MATLAB string containing from which the numbers must be retrieved
10%> such as software version corresponding to major, minor, and patch versions.<br>
11%> \param[in] sep : The input scalar MATLAB string containing a string
12%> to be used the separator in splitting.<br>
13%>
14%> \return
15%> ``real`` : The output MATLAB vector of size ``nsep + 1`` containing
16%> the numbers retrieved from the input version string, where ``nsep``
17%> represents the number of input ``sep`` found in the input string.<br>
18%> If the specified input ``sep`` is empty ``[]``, the default value is used.<br>
19%> (**optional**, default = ``"."``)
20%>
21%> \interface{split2real}
22%> \code{.m}
23%>
24%> real = pm.str.split2real(str)
25%> real = pm.str.split2real(str, [])
26%> real = pm.str.split2real(str, sep)
27%>
28%> \endcode
29%>
30%> \final{split2real}
31%>
32%> \example{split2real}
33%> \include{lineno} example/str/split2real/main.m
34%> \output{split2real}
35%> \include{lineno} example/str/split2real/main.out.m
36%>
37%> \author
38%> \JoshuaOsborne, May 21 2024, 4:41 AM, University of Texas at Arlington<br>
39%> \FatemehBagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.<br>
40%> \AmirShahmoradi, May 16 2016, 9:03 AM, Oden Institute for Computational Engineering and Sciences (ICES), UT Austin<br>
41function real = split2real(str, sep)
42 if nargin < 2
43 sep = [];
44 end
45 if isempty(sep)
46 sep = ".";
47 end
48 real = str2double(string(strsplit(str, sep)));
49end
function version(in silent)
Return a scalar MATLAB string containing the latest available ParaMonte MATLAB version newer than the...
function split2real(in str, in sep)
Return a vector of real values by splitting the input str string by the specified input sep.
function which(in vendor)
Return the a MATLAB string containing the path to the first mpiexec executable binary found in system...