登录论坛

查看完整版本 : Matlab - Incorrect dimensions for raising a matrix to a power


poster
2019-11-25, 06:21
<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>



More answer... (https://stackoverflow.com/questions/59022821/matlab-incorrect-dimensions-for-raising-a-matrix-to-a-power)