diff options
-rw-r--r-- | get_products.m | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/get_products.m b/get_products.m index eed1c00..86668de 100644 --- a/get_products.m +++ b/get_products.m @@ -2,18 +2,6 @@ function [A,B] = get_products() load('-ascii', 'train_noheader.csv'); load('-ascii', 'class_noheader.csv'); - A = zeros(42+14, 570); - B = zeros(42, 570); - for i = 1:42 - begin = 570 * (i-1) + 1; - ende = begin + 569; - A(i,:) = train_noheader(begin:ende,3)'; - B(i,:) = train_noheader(begin:ende,4)'; - end - for i = 43:56 - begin = 570 * (i-42-1) + 1; - ende = begin + 569; - A(i,:) = class_noheader(begin:ende,3)'; - end - + A = reshape([train_noheader(:,3); class_noheader(:,3)], 570, [])'; + B = reshape( train_noheader(:,4), 570, [])'; endfunction |