title: How can I add a key-value pair to a Containers.Map object?
body: <h1>Question</h1>
  
  <p>I have a <a href="https://www.mathworks.com/help/matlab/ref/containers.map.html" rel="nofollow noreferrer"><code>Containers.Map</code></a> object with 155 key-value pairs. I would like to add a key-value pair to that object, is there a function that allows me to do this easily?</p>
  
  <h1>Starting situation</h1>
  
  <pre><code>keys = {'apples', 'bananas', 'lemons', 'oranges'};
  values = {1, 2, 3, 4};
  M = containers.Map(keys, values);
  </code></pre>
  
  <h1>What have I tried</h1>
  
  <h2>Using the <a href="https://www.mathworks.com/help/matlab/ref/add.html" rel="nofollow noreferrer"><code>add</code></a> function</h2>
  
  <pre><code>add(M, 'peaches', '5')
  </code></pre>
  
  <p><code>Undefined function 'add' for input arguments of type 'containers.Map'.</code></p>
  
  <h2>Re-creating the Containers.Map object</h2>
  
  <pre><code>keys = N.keys
  values = N.values
  keys = [keys, 'peaches']
  values = [values, 5]
  M = containers.Map(keys, values)
  </code></pre>
  
  <p>This works, but is cumbersome to do, so can be seen as a workaround.<br>
  I am hoping to find a function similar to <a href="https://nl.mathworks.com/help/matlab/ref/containers.map.remove.html" rel="nofollow noreferrer"><code>remove</code></a>.</p>