function uvector=doublet(t,tswitch,tend,mag)
%function uvector=doublet(t,tswitch,tend,mag)
% makes a doublet of magnitude mag that switches at 
% tswitch ane ends at tend.
% time is a vector of time points.
% u is an doublet output vector the size of t transposed.
k1=find(t<=tswitch);
k2=find(t>tswitch & t<=tend);
uvector=zeros(size(t'));
uvector(k1)=mag;
uvector(k2)=-mag;


