From c877d4871fea3826afc192bfb5efe0b42b53b130 Mon Sep 17 00:00:00 2001 From: Jan Klemkow Date: Sat, 12 May 2012 11:03:34 +0200 Subject: opt_pred: Split opt_pred in opt_idx and opt_pred. So you can use the idx of opt_idx for other predictions. --- opt_idx.m | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 opt_idx.m (limited to 'opt_idx.m') diff --git a/opt_idx.m b/opt_idx.m new file mode 100644 index 0000000..76864c8 --- /dev/null +++ b/opt_idx.m @@ -0,0 +1,10 @@ +function idx = opt_idx(real_data, pred_list) + + err_list = zeros(size(pred_list, 2), size(real_data, 2)); + + for i = 1:size(pred_list, 2) + err_list(i,:) = sum(abs(real_data - pred_list{i})); + end + + [min_err, idx] = min(err_list); +end -- cgit