diff options
author | leochanj105 <leochanj@live.unc.edu> | 2020-10-19 23:09:30 -0400 |
---|---|---|
committer | leochanj105 <leochanj@live.unc.edu> | 2020-10-20 02:40:39 -0400 |
commit | f618466c25d43f3bae9e40920273bf77de1e1149 (patch) | |
tree | 460e739e2165b8a9c37a9c7ab1b60f5874903543 /SD-VBS/benchmarks/svm/src/matlab/usps_read_partial.m | |
parent | 47ced4e96bbb782b9e780e8f2cfc637b2c21ff44 (diff) |
initial sd-vbs
initial sd-vbs
add sd-vbs
sd-vbs
Diffstat (limited to 'SD-VBS/benchmarks/svm/src/matlab/usps_read_partial.m')
-rw-r--r-- | SD-VBS/benchmarks/svm/src/matlab/usps_read_partial.m | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/SD-VBS/benchmarks/svm/src/matlab/usps_read_partial.m b/SD-VBS/benchmarks/svm/src/matlab/usps_read_partial.m new file mode 100644 index 0000000..fab2a8f --- /dev/null +++ b/SD-VBS/benchmarks/svm/src/matlab/usps_read_partial.m | |||
@@ -0,0 +1,28 @@ | |||
1 | function ret=usps_read_partial(datacell_1, datacell_2, idx, opt,dim, Iterations) | ||
2 | |||
3 | X=datacell_1(1:dim,:); | ||
4 | if (opt == 1) | ||
5 | for i=2:Iterations | ||
6 | temp = datacell_2(1:dim,:); | ||
7 | X = [X;temp]; | ||
8 | end | ||
9 | else | ||
10 | for i=1:Iterations | ||
11 | if idx==0 | ||
12 | ADD=zeros(dim,1)+i; | ||
13 | else | ||
14 | if i~=idx | ||
15 | ADD=ones(dim,1)*-1; | ||
16 | else | ||
17 | ADD=ones(dim,1); | ||
18 | end | ||
19 | end | ||
20 | if i==1 | ||
21 | X=ADD; | ||
22 | else | ||
23 | X=[X; ADD]; | ||
24 | end | ||
25 | end | ||
26 | end | ||
27 | ret = X; | ||
28 | |||