title: How to calculate argmax in MATLAB?
body: <p>Argmax: <a href="https://en.wikipedia.org/wiki/Arg_max" rel="nofollow noreferrer">https://en.wikipedia.org/wiki/Arg_max</a></p>
  
  <p>Since there was some confusion i will describe what argmax does:</p>
  
  <p>argmax finds arguments for a function so that this function is maximized.</p>
  
  <pre><code>Simple example: x * (10 - x)
  x = 1 -&gt; 1 * (10 - 1) = 9
  x = 2 -&gt; 2 * (10 - 2) = 16
  ...
  x = 5 -&gt; 5 * (10 - 5) = 25
  x = 6 -&gt; 6 * (10 - 6) = 24
  </code></pre>
  
  <p>So in this example argmax would give x = 5. argmax should do this for multiple variables in one function.</p>
  
  <hr>
  
  <p>I'm trying to solve this formula from the paper <a href="http://www.jmlr.org/proceedings/papers/v49/christiano16.pdf" rel="nofollow noreferrer">Provably Manipulation-Resistant Reputation Systems</a>:</p>
  
  <p><a href="https://i.stack.imgur.com/xnTMd.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xnTMd.jpg" alt="argmax"></a></p>
  
  <p><a href="https://i.stack.imgur.com/cwXOa.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cwXOa.jpg" alt="product"></a></p>
  
  <p><code>X</code> is a matrix with variables for which i want to find the values that maximize the formula.</p>
  
  <p>I allready tried it with Wolfram|Cloud but the free plan has a too small memory restriction: <a href="https://mathematica.stackexchange.com/questions/135372/wolframcloud-memory-limit-exceeded">Wolfram|Cloud memory limit exceeded</a></p>
  
  <p>I have a local MATLAB R2016b version and would like to program this formulas in MATLAB.</p>
  
  <p><strong>Does MATLAB have a argmax function?</strong></p>