MATLAB: Complex multiplication giving wrong answer

complex multiplicationmatrix multiplicationsymmetrical components

I am trying to extract positive sequence currents using method of symmetrical components .However I am getting wrong answer. The following is my test code.
a=exp(i*2*pi/3)
P1=[1 a a^2]
%Balanced Voltages and Unbalanced Currents
Va=5*exp(j*53*pi/180);
Vb=7*exp(-j*164*pi/180);
Vc=7*exp(j*105*pi/180);
V1=(1/3)*P1*[Va Vb Vc]'
Va1=(1/3)*(Va+a*Vb+a^2*Vc)
Though V1 and Va1 should be same, I am getting different answers. Please tell me whats wrong in the calculation of V1 ( Va1 calculation method gives correct answer)

Best Answer

The trouble lies in the line
V1=(1/3)*P1*[Va Vb Vc]'
You should have used this:
V1=(1/3)*P1*[Va Vb Vc].
As you have written it, [Va Vb Vc]' not only takes the transpose of [Va Vb Vc], it also changes each element to its complex conjugate, which you don’t want in this example. Read about it at: