%%% swsig.m Example switched signal
%   by Chuck DiMarzio
%      Northeastern University
%      June 2009
%
t=[0.1:0.1:100];  % Time (microseconds)
temp=(rand(1,50)>0.5);  % Next two lines make a random pulse code
pulse=reshape(repmat(temp,20,1),1,1000);
noise=rand(size(t));    %  random noise
p=ones(size(t))+0.03*pulse+0.01*noise;
fig1=figure;plot(t,p);grid on;
axis([0,100,0.9,1.1]);
xlabel('t, Time, \mu s');ylabel('P, Power, \mu W');