MATLAB: Matrix dimensions must agree

(.^)inner matrixmatrix dimensions

mu = [10
20
30
45
50
60];
Ve= [125
120
120
120
120
120];
P= [17
17
17.5
20
20
25];
a=cos(mu);
x=(1000./Ve.^2)*(1/a);
y= P.^((x.^(3/2)));

Best Answer

mu = [10
20
30
45
50
60];
Ve= [125
120
120
120
120
120];
P= [17
17
17.5
20
20
25];
a=cos(mu);
x=(1000./Ve.^2).*(1./a);
% ^---^-----missed dots
y= P.^(x.^(3/2));
Gives:
>> x
x =
-0.0763
0.1702
0.4502
0.1322
0.0720
-0.0729
>> y
y =
0.9982 - 0.0596i
1.2200 + 0.0000i
2.3740 + 0.0000i
1.1549 + 0.0000i
1.0595 + 0.0000i
0.9980 - 0.0633i
>>