From 15bb6f8eee41f2ca3e8ba7fedc4929bcdfc539e7 Mon Sep 17 00:00:00 2001 From: Mart Lubbers Date: Fri, 2 Oct 2015 10:20:03 +0200 Subject: [PATCH] plots script works for both --- mart/ex10/ex10ab.m | 15 --------------- mart/ex10/plots.m | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 15 deletions(-) delete mode 100644 mart/ex10/ex10ab.m create mode 100644 mart/ex10/plots.m diff --git a/mart/ex10/ex10ab.m b/mart/ex10/ex10ab.m deleted file mode 100644 index f1af50a..0000000 --- a/mart/ex10/ex10ab.m +++ /dev/null @@ -1,15 +0,0 @@ -d = csvread("ex10a.csv")(:,2) ./ 1000; -dmax = max(d); -dmin = min(d); -davg = mean(d); -ddev = std(d); -plot(d, '@k'); -title("Measurements on jitter"); -xlabel("Number of the measurement"); -ylabel("Time till next measurement in microseconds"); -stepsize = (dmax+dmin)/25; -text(100, dmax-stepsize, sprintf("Min: %d", dmin)); -text(100, dmax-stepsize*2, sprintf("Mean: %.2f", davg)); -text(100, dmax-stepsize*3, sprintf("Std: %.2f", ddev)); -text(100, dmax-stepsize*4, sprintf("Max: %d", dmax)); -print -dpng "-S1200,1200" ex10ab.png diff --git a/mart/ex10/plots.m b/mart/ex10/plots.m new file mode 100644 index 0000000..062657e --- /dev/null +++ b/mart/ex10/plots.m @@ -0,0 +1,33 @@ +d = csvread("ex10ab.csv")(:,2) ./ 1000; +dmax = max(d); +dmin = min(d); +davg = mean(d); +ddev = std(d); +figure; +plot(d, '@k'); +title("Measurements on jitter"); +xlabel("Number of the measurement"); +ylabel("Time till next measurement in microseconds"); +stepsize = (dmax+dmin)/25; +text(100, dmax-stepsize, sprintf("Min: %d", dmin)); +text(100, dmax-stepsize*2, sprintf("Mean: %.2f", davg)); +text(100, dmax-stepsize*3, sprintf("Std: %.2f", ddev)); +text(100, dmax-stepsize*4, sprintf("Max: %d", dmax)); +print -dpng "-S1200,1200" ex10ab.png + +d = csvread("ex10d.csv")(:,2); +dmax = max(d); +dmin = min(d); +davg = mean(d); +ddev = std(d); +figure; +plot(d, '@k'); +title("Measurements on interrupt latency via LPT1"); +xlabel("Number of the measurement"); +ylabel("Time till next measurement in nanoseconds"); +stepsize = (dmax+dmin)/25; +text(100, dmax-stepsize, sprintf("Min: %d", dmin)); +text(100, dmax-stepsize*2, sprintf("Mean: %.2f", davg)); +text(100, dmax-stepsize*3, sprintf("Std: %.2f", ddev)); +text(100, dmax-stepsize*4, sprintf("Max: %d", dmax)); +print -dpng "-S1200,1200" ex10ab.png -- 2.20.1