close all;
x = -10 :0.01 :10;
n = length(x);
f1 = zeros(n,1);
f2 = zeros(n,1);
f1((n-1)/20*10) = 1;
f1((n-1)/20*7+1) = 1;
figure,plot(x,f1),axis([-10 10 -0.2 1.2]);
f2((n-1)/20*10 :(n-1)/20*16+1) = ones(size((n-1)/20*10 :(n-1)/20*16+1));
figure,plot(x,f2),axis([-10 10 -0.2 1.2]);