|
|
@@ -6,32 +6,39 @@ 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)
|
|
|
+ if(modulo(i, 5) == 0) // Only each fifth should be pulse
|
|
|
disp('yoman!')
|
|
|
ylong = [ylong y];
|
|
|
- else
|
|
|
+ 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, 'white');
|
|
|
-plot(ones(1,length(ylong))*max(ylong)*1.01, 'white');
|
|
|
+//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), '$']) ];
|