f=10;

A1=10;
A2=10;
A3=20;

phi1=pi/4;
phi2=3*pi/4;
phi3=-3*pi/4;

tt =0:1/1000:0.5;

%% 3 sinusoids
x1 = A1*cos(2*pi*f*tt+phi1);
x2 = A2*cos(2*pi*f*tt+phi2);
x3 = A3*cos(2*pi*f*tt+phi3);

plot(tt,x1+x2+x3,'b');

%% 3 complex exponentials
X1 = A1*exp(j*phi1);
X2 = A2*exp(j*phi2);
X3 = A3*exp(j*phi3);

cx1 = X1*exp(j*2*pi*f*tt);
cx2 = X2*exp(j*2*pi*f*tt);
cx3 = X3*exp(j*2*pi*f*tt);

hold on
plot(tt, real(cx1+cx2+cx3),'ro');

%% phasor addition
X = X1+X2+X3;
plot(tt, real(X*exp(j*2*pi*f*tt)), 'kv')
hold off