diff options
Diffstat (limited to 'opt_pred.m')
-rw-r--r-- | opt_pred.m | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -1,16 +1,15 @@ function pred = opt_pred(real_data, pred_list) - err_list = []; + err_list = zeros(size(pred_list, 2), size(real_data, 2)); for i = 1:size(pred_list, 2) - err_list = [err_list; sum(abs(real_data - pred_list{i}))]; + err_list(i,:) = sum(abs(real_data - pred_list{i})); end [min_err, idx] = min(err_list); - - pred = []; + pred = zeros(size(real_data)); for i = 1:size(idx, 2) - pred = [pred pred_list{idx(i)}(:,i)]; + pred(:,i) = pred_list{idx(i)}(:,i); end end |