Hi Jose,
I understand that you are trying to add two sinusoids with phase shift.
You can try to make an array corresponding to phi(x), where ‘x’ is same as time steps you have specified. The total number of samples in your case is 1001 (0:0.05ns:50ns). The phi(x) is given as
Phi(x) = 0 for 0 < x < 12.5 ns
Phi(x) = pi for 12.5 ns < x < 37.5 ns
Phi(x) = 0 for 37.5 ns < x < 50 ns
12.5 ns corresponds to 251th sample, similarly 37.5 ns corresponds to 751th sample. The following code snippet creates phi(x) and Vout(x)
Phi = zeros(1,1001);
Phi(251:750) = pi;
Vout = m.*cos(wo*x + Phi);
Hope this solves your query.