diff options
author | Jan Klemkow <j.klemkow@wemelug.de> | 2012-05-11 15:53:29 +0200 |
---|---|---|
committer | Jan Klemkow <j.klemkow@wemelug.de> | 2012-05-11 15:56:17 +0200 |
commit | 104f6e134d7ebb84f68dbe25e6f34b31e21e97ec (patch) | |
tree | 87c55367155e66e49a9f61deada69d9399e9b3a1 | |
parent | 873ab39c40ff271502132fa1e1ea1eb4e93940da (diff) | |
download | dmc-104f6e134d7ebb84f68dbe25e6f34b31e21e97ec.tar.gz dmc-104f6e134d7ebb84f68dbe25e6f34b31e21e97ec.tar.bz2 dmc-104f6e134d7ebb84f68dbe25e6f34b31e21e97ec.zip |
rand_pred: Code clean up.
-rw-r--r-- | rand_pred.m | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/rand_pred.m b/rand_pred.m index 2e38e80..2bca8b6 100644 --- a/rand_pred.m +++ b/rand_pred.m @@ -1,9 +1,9 @@ function pred = rand_pred(price, data) times = size(price, 1) - size(data, 1); - pred = abs(normrnd(mean(data), sqrt(var(data)))); + pred = zeros(times, 1); - for i = 1:(times-1) - pred = [ pred; abs(normrnd(mean(data), sqrt(var(data))))]; + for i = 1:times + pred(i) = abs(normrnd(mean(data), sqrt(var(data)))); end end |