Generate binary signal and convert to integer in Matlab
@Ali23. If by &quot;How can I get a blue lines?&quot; you mean how to generate samples of the your red curve, try the following:
m = [1, -1, -1, 1 1, -1]; m = [m m m m];
N = length(m);
M = 10; mup=zeros(1,NM); mup(1:M:NM)=m;  % oversample by M
h = hamming(M);                     % blip pulse of width M
x = filter(h,1,mup);     % convolve pulse shape with 'm' data
t = 1/M:1/M:length(x)/M;
figure(1), subplot(2,1,1), plot(0:0.1:0.9,h)
subplot(2,1,2), plot(t,x)
In the above I used a simple hamming sequence rather than the impulse response of a RRC filter. (You should use the impulse response of a RRC filter.) The key point here is that you have to upsample (zero stuffing) the 'm' sequence before you apply it to the filter.