Problem: Generate one signal of some width and height.
Matlab
clear all; close all; f = [1 0.5 0.25]; w = [0.5 1 2]; h = [1 1.5 0.4]; figure; for i=1:3 t=0:0.01:w(i); y=h(i)*square(2*pi*f(i)*t); subplot(3,1,i); plot(t,y,'r','LineWidth',3); grid on; xlim([-2 2.5]); ylim([-.6 2.5]); title(sprintf... ('pulse of %2.1f sec width and amplitude=%2.1f',... w(i),h(i))); end