From: Michal Sojka Date: Mon, 20 Jan 2014 09:16:41 +0000 (+0100) Subject: Preprocess only files that exist, don't fail on missing file X-Git-Tag: fix-allnoconfig~63 X-Git-Url: http://rtime.felk.cvut.cz/gitweb/can-benchmark.git/commitdiff_plain/18fae62183b4e5e8caeae62fc413df79fd44edce Preprocess only files that exist, don't fail on missing file --- diff --git a/ugw/data/preprocess.m b/ugw/data/preprocess.m index a43578d..ef729fd 100755 --- a/ugw/data/preprocess.m +++ b/ugw/data/preprocess.m @@ -22,16 +22,22 @@ quantiles = [0 0.5 0.90 0.99]; mat = zeros(0, length(quantiles) + 2); names = {}; -for i=1:length(argv), +for i=1:length(datafiles), [d, n, e, v] = fileparts(datafiles{i}); - x = load(datafiles{i})*1e6; - stat = csv2cell([n, "-stat.txt"], '='); - lost = stat{6,2}; - q = quantile (x, quantiles); - q = max(q, 0)'; - avg = mean(x); + try + x = load(datafiles{i})*1e6; + stat = csv2cell([n, "-stat.txt"], '='); + lost = stat{6,2}; + q = quantile (x, quantiles); + q = max(q, 0)'; + avg = mean(x); + catch + disp(["Skiping ", n]); + continue + end_try_catch mat = [ mat; q lost avg ]; - names{i} = n; + names{length(names)+1} = n; + disp(["Added ", n]); end if 0,