2%> Return the input ``hashmap`` with the
new ``(key, val)`` appended,
3%> only
if the input pair does not exist in the input ``hashmap``.<br>
4%> If the pair exists, replace it with the
new value.<br>
6%> \param[in] key : The input scalar MATLAB
string
7%> containing the key to add to the input pair
list.
8%> \param[in] val : The input value to be appended to the
9%> input ``hashmap`` after the input ``key``.
10%> \param[in] hashmap : The input cell array of even number of elements
11%> containing the ``(key, val)`` pairs of the ``hashmap``
12%> in sequence as element of the cell array.
15%> ``hashnew`` : The output cell array of even number of elements
16%> containing the input pair
list and ``(key, val)`` pair.<br>
17%> If the input ``key`` exists in the input ``hashmap``,
18%> the input ``(key, val)`` pair will not be added.<br>
23%> hashnew = pm.matlab.hashmap.repKeyVal(key, val, hashmap)
28%> \include{lineno} example/matlab/hashmap/
repKeyVal/main.m
30%> \include{lineno} example/matlab/hashmap/
repKeyVal/main.out.m
35%> \JoshuaOsborne, May 21 2024, 10:52 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>
40 vararginLen = length(hashnew);
41 keyString = string(key);
43 for i = 1 : vararginLen - 1
45 if strcmpi(
string(hashnew{i}), keyString)
55 hashnew = {hashnew{:}, key, val};
function list()
Return a list of MATLAB strings containing the names of OS platforms supported by the ParaMonte MATLA...
function repKeyVal(in key, in val, in hashmap)
Return the input hashmap with the new (key, val) appended, only if the input pair does not exist in t...