2%> Return the value corresponding to the input ``key``
3%> in the input ``hashmap`` cell array.
5%> \param[in] key : The input scalar MATLAB
string
6%> containing the key to search
for in the input pair
list.
8%> \param[in] hashmap : The input cell array of even number of elements
9%> containing the ``(key, val)`` pairs of the hashmap
10%> in sequence as element of the cell array.
13%> ``val`` : The output MATLAB
object stored in the element of the
14%> input cell array, whose ``key`` is given as the input.
16%> ``failed`` : The output scalar MATLAB logical that is ``
true``
17%>
if and only
if the input ``key`` exists in the input ``hashmap``,
18%> otherwise, it is ``
false``.<br>
19%> (**optional**. If missing, ``val`` will remain an empty array ``[]`` on output.)
24%> val = pm.matlab.hashmap.getKeyVal(key, hashmap)
25%> [val, failed] = pm.matlab.hashmap.getKeyVal(key, hashmap)
30%> The length of the input ``hashmap`` must be even.<br>
31%> Ann odd length of the input cell array will lead to a runtime call to the MATLAB intrinsic ``error()``.<br>
34%> \include{lineno} example/matlab/hashmap/
getKeyVal/main.m
36%> \include{lineno} example/matlab/hashmap/
getKeyVal/main.out.m
41%> \JoshuaOsborne, May 21 2024, 10:43 PM, University of Texas at Arlington<br>
42%> \FatemehBagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.<br>
43%> \AmirShahmoradi, May 16 2016, 9:03 AM, Oden Institute
for Computational Engineering and Sciences (ICES), UT Austin<br>
45 vararginLen = length(hashmap);
46 if mod(vararginLen, 2) ~= 0
47 help(
"pm.matlab.hashmap.getKeyVal");
49 +
"The length of ``hashmap`` must be even." + newline ...
51 +
"length(hashmap) = " +
string(vararginLen) + newline ...
59 for i = 1 : vararginLen - 1
60 if strcmpi(
string(hashmap{i}),
string(key))
function list()
Return a list of MATLAB strings containing the names of OS platforms supported by the ParaMonte MATLA...
function getKeyVal(in key, in hashmap)
Return the value corresponding to the input key in the input hashmap cell array.