Date: Dec 4, 2012 2:07 PM
Subject: square wave
I have a square wave which I have scaled to be in the interval [0,1].I want to put the value 1 when I have a square pulse and zero otherwise (so as when summing the sequential aces I would have the duration of each the pulse). THen I want to plot the original wave and the one with the zeros and aces in the same graph. I did this:
b(1:simafin(1)) = zeros(1,simafin(1));
for ii = 2:length(simafin)
b = [b ones(1,simafin(ii))];
b = [b zeros(1,simafin(ii))];
but when i tried to plot b, its pulses weren't in the same place as the pulses of simafin.Any ideas what I'm doing wrong?