xdel(winsid()) clear; t = [0:0.01:10]; a = 1; b = 2; k = 1; offset = 0; y = k*(exp(-a*t) - exp(-b*t) ); ymax = max(y)*ones(1,length(y)); // Create repetetive puses ylong=[]; tlong=[]; for i = [-1:11] if(modulo(i, 5) == 0) // Only each fifth should be pulse disp('yoman!') ylong = [ylong y]; else // The rest is zero disp('shitdude!') ylong = [ylong zeros(1,length(y))]; end end // Add offset voltage and create x axis ylong = ylong + offset; xlong = [1:length(ylong)]; // Plot vertical lines xpts = [1 1]; ypts = [-1 0]; plot(xpts*1000, ypts, '--'); plot(xpts*6000, ypts, '--'); //plot(xpts*8.96, ypts, '--'); // Plot lines plot(ylong, 'black'); //plot(ones(1,length(ylong))*-.01, 'black'); //plot(ones(1,length(ylong))*max(ylong)*1.01, 'black'); //plot(t,ymax.*0.9, '--'); // titletxt = ['$y = k(e^{-\alpha t} - e^{-\beta t})$' ; strcat(['$k=', string(k), ', \alpha=', string(a), ', \beta=', string(b), '$']) ]; titletxt = '$y = k(e^{-\alpha t} - e^{-\beta t})$'; title("Consecutive pulses", 'fontsize', 8); xlabel('t (s)', 'fontsize', 7); ylabel('U (V)', 'fontsize', 7, 'rotation', 0); a = get("current_axes"); a.axes_visible = "off"; //a.margins = [0 0 0 0]; //a.zoom_box=[1,-0.01;10013,0.2524975]; a.data_bounds = [1,-0.01;11500,0.2524975]; //zoom_rect([-1,-1,1,1]);