title: How to implement this function in mupad (MATLAB)
body: <p>I want to implement the following function. But I dont know how to define a function over a set of variables such as <code>mu(1)</code>, <code>mu(2)</code>, <code>mu(3)</code>,..., <code>mu(c)</code>. <code>c</code> is a numeric symbol (i.e. it is a parameter of the function, but not an input value):</p>
  
  <pre><code>f := (mu(i), i=1..c) -&gt; sum(mu(i)^2,i=1..c)
  </code></pre>
  
  <p>In other words, I want the symbolic form of <code>f(MU)=norm(MU)^2</code>, where <code>MU</code> is a vector of <code>1xc</code> variables.</p>
  
  <p>Thanks</p>
  
  <p><strong>EDIT</strong>:
  In fact, I want to trace the following computation in mupad from <a href="http://books.google.com/books?id=XNHzqfvMTbwC&amp;pg=PA323&amp;dq=fuzzy+c-means+lagrange&amp;hl=en&amp;sa=X&amp;ei=TL-9UKqFDoui8ATEx4DIBA&amp;ved=0CC8Q6AEwAA#v=onepage&amp;q=fuzzy%20c-means%20lagrange&amp;f=false" rel="nofollow noreferrer">Modeling Uncertainty with Fuzzy Logic: With Recent Theory and ...</a>. </p>
  
  <p>I have also attached the picture of computation steps (of fuzzy c-means).</p>
  
  <p><img src="https://i.stack.imgur.com/xap0D.png" alt="calculations"></p>