Matlab - Incorrect dimensions for raising a matrix to a power : <p>Suppose we have <code>a=60</code> and <code>B=60</code>. I am trying to calculate this area:</p>

<p><a href="https://i.stack.imgur.com/qE4bT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qE4bT.png" alt="enter image description here"></a></p>

<p>when I try this:</p>

<pre class="lang-matlab prettyprint-override"><code>W = ((u^2)* cot(B) + (v^2 * cot(a))/8;
</code></pre>

<p>I get this error:</p>

<blockquote>
  <p>Incorrect dimensions for raising a matrix to a power. Check that the matrix is square and the power is a scalar. To perform elementwise matrix powers,
  use '.^'.</p>
</blockquote>

<p>How can I use <code>u^2</code> in the right way?</p>
