MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   资料存档 (https://www.labfans.com/bbs/forumdisplay.php?f=72)
-   -   Matlab - Incorrect dimensions for raising a matrix to a power (https://www.labfans.com/bbs/showthread.php?t=22121)

poster 2019-11-25 06:21

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>



[url=https://stackoverflow.com/questions/59022821/matlab-incorrect-dimensions-for-raising-a-matrix-to-a-power]More answer...[/url]


所有时间均为北京时间。现在的时间是 19:56

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.