I can create an rectangular pulse with code
b1 = 5;a1 = 5;x = -10:0.01:10;% a pulse function
f = @(xi,a,b) a*rectpuls(xi,b); % plot to
plot(x,f(x,a1,b1),'b--'); title(['Rectangular Pulse']);xlabel('Time');ylabel('Amplitude');
I now want to move this pulse, to start from x = -2 and end at x=+3, i.e. not have it centred around zero?
Any idea how to make it so?
Best Answer