summaryrefslogtreecommitdiffstats
path: root/SD-VBS/benchmarks/svm/src/matlab/usps_read_partial.m
diff options
context:
space:
mode:
authorleochanj105 <leochanj@live.unc.edu>2020-10-19 23:09:30 -0400
committerleochanj105 <leochanj@live.unc.edu>2020-10-20 02:40:39 -0400
commitf618466c25d43f3bae9e40920273bf77de1e1149 (patch)
tree460e739e2165b8a9c37a9c7ab1b60f5874903543 /SD-VBS/benchmarks/svm/src/matlab/usps_read_partial.m
parent47ced4e96bbb782b9e780e8f2cfc637b2c21ff44 (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.m28
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 @@
1function ret=usps_read_partial(datacell_1, datacell_2, idx, opt,dim, Iterations)
2
3X=datacell_1(1:dim,:);
4if (opt == 1)
5 for i=2:Iterations
6 temp = datacell_2(1:dim,:);
7 X = [X;temp];
8 end
9else
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
26end
27ret = X;
28