|
|
@@ -1,13 +1,13 @@
|
|
|
xdel(winsid())
|
|
|
clear;
|
|
|
|
|
|
-t = linspace(-2,20,2000);
|
|
|
+t = linspace(-4,20,5000);
|
|
|
a = 0.4;
|
|
|
b = 0.45;
|
|
|
k = 1;
|
|
|
|
|
|
magnitude = 100;
|
|
|
-offset = 24
|
|
|
+offset = 20
|
|
|
|
|
|
// Generera självaste pulsformen
|
|
|
y = k*(exp(-a*t) - exp(-b*t) );
|
|
|
@@ -60,20 +60,34 @@ y = y+offset;
|
|
|
|
|
|
//Generera vertikala linjer
|
|
|
xpts = [1 1];
|
|
|
-ypts = [-100 max(y)*2];
|
|
|
//plot(xpts*0, ypts, '-black'); // Vertikalt streck på x =
|
|
|
-plot(xpts*t(x10r), ypts, ':');
|
|
|
-plot(xpts*t(x90r), ypts, ':');
|
|
|
-plot(xpts*t(x10f), ypts, '-.');
|
|
|
+ypts = [(0.1*magnitude+offset) max(y)*1.5];
|
|
|
+plot(xpts*t(x10r), ypts, '-');
|
|
|
+plot(xpts*t(x10f), ypts, '-');
|
|
|
+ypts = [(0.9*magnitude+offset) max(y)*1.25];
|
|
|
+plot(xpts*t(x90r), ypts, '-');
|
|
|
|
|
|
// Generera horisontella linjer
|
|
|
+
|
|
|
+// Pulsen
|
|
|
plot(t, y, "black");
|
|
|
-hline = ones(1,length(y));
|
|
|
-plot(t,hline.*y(x10r), ':');
|
|
|
p = get("hdl");
|
|
|
p = p.children;
|
|
|
-p.line_style = 7;
|
|
|
-plot(t,hline.*y(x90r), ':');
|
|
|
+p.thickness = 3;
|
|
|
+
|
|
|
+// max och min horisontella
|
|
|
+hline = ones(1,length(t));
|
|
|
+plot(t,hline.*max(y), '--');
|
|
|
+plot(t,hline.*min(y), '--');
|
|
|
+plot(t,hline.*0, '-black');
|
|
|
+
|
|
|
+// 10 och 90% horizontella
|
|
|
+tshort = t(x10r-150:length(t))
|
|
|
+hline = ones(1,length(tshort));
|
|
|
+plot(tshort,hline.*y(x10r), '-');
|
|
|
+tshort = t(x10r-150:x90r)
|
|
|
+hline = ones(1,length(tshort));
|
|
|
+plot(tshort,hline.*y(x90r), '-');
|
|
|
|
|
|
// titletxt = ['$y = k(e^{-\alpha t} - e^{-\beta t})$' ; strcat(['$k=', string(k), ', \alpha=', string(a), ', \beta=', string(b), '$']) ];
|
|
|
|
|
|
@@ -89,5 +103,19 @@ a = get("current_axes");
|
|
|
//a.y_location = "origin";
|
|
|
|
|
|
|
|
|
-a.data_bounds = [min(t),-0.02;max(t),200];
|
|
|
+// Bestäm viewport och ta bort inramning
|
|
|
+a.data_bounds = [min(t),0;max(t),200];
|
|
|
+a.box = "off";
|
|
|
+
|
|
|
+
|
|
|
+// Fula pilar (nästan) på axlarna
|
|
|
+//b = a.data_bounds
|
|
|
+//xstring(b(1),b(4),"↑")
|
|
|
+//set(gce(), "clip_state","off", "text_box_mode","centered", "font_size",4)
|
|
|
+//
|
|
|
+//xstring(b(2),b(3),"→")
|
|
|
+//set(gce(), "clip_state","off", "text_box_mode","centered", "font_size",4)
|
|
|
+
|
|
|
+f=get("current_figure")
|
|
|
+f.figure_size=f.figure_size*1.3 // Råkade bli lagom storlek
|
|
|
|