diff options
author | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2012-05-11 15:39:55 +0200 |
---|---|---|
committer | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2012-05-11 15:39:55 +0200 |
commit | 873ab39c40ff271502132fa1e1ea1eb4e93940da (patch) | |
tree | 3cfa3f8a7b7dcf8554166135067ddd585b548d15 | |
parent | b5adc6444724e5761defeb1bb9d622e73fe23339 (diff) | |
download | dmc-873ab39c40ff271502132fa1e1ea1eb4e93940da.tar.gz dmc-873ab39c40ff271502132fa1e1ea1eb4e93940da.tar.bz2 dmc-873ab39c40ff271502132fa1e1ea1eb4e93940da.zip |
run_tests: Pack struct definition into a anonymous function
-rw-r--r-- | run_tests.m | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/run_tests.m b/run_tests.m index 8578b22..f0ccc6d 100644 --- a/run_tests.m +++ b/run_tests.m @@ -6,14 +6,15 @@ train_data = q( 1:28, :); real_data = q(29:42, :); +m = @(n,f) struct('name', n, 'func', f ); pred_methods = [ - struct('name', 'mean', 'func', @mean_pred ) - struct('name', 'regress', 'func', @regress_pred ) - struct('name', 'quad', 'func', @quad_regress_pred ) - struct('name', 'log reg.', 'func', @log_regress_pred ) - struct('name', 'sevenday', 'func', @sevenday_pred ) - struct('name', 'random', 'func', @rand_pred ) - struct('name', 'regress2', 'func', @regress_frequency_removal ) + m('mean', @mean_pred) + m('regress', @regress_pred) + m('quad', @quad_regress_pred) + m('log reg.', @log_regress_pred) + m('sevenday', @sevenday_pred) + m('random', @rand_pred) + m('regress2', @regress_frequency_removal) ]; num_methods = size(pred_methods, 1); |