-3

Suppose we have a=60 and B=60. I am trying to calculate this area:

enter image description here

when I try this:

W = ((u^2)* cot(B) + (v^2 * cot(a))/8;

I get this error:

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 '.^'.

How can I use u^2 in the right way?

Hadi GhahremanNezhad
  • 2,377
  • 5
  • 29
  • 58

1 Answers1

2

If u and v are a vector, you should write u.^2 and v.^2 instead (an element-wise operator). When you write u^2 means u * u and it does not mean when u is not a squared matrix.

However, if they are vector, it is not meant for computing the value of W.

OmG
  • 18,337
  • 10
  • 57
  • 90