-
Notifications
You must be signed in to change notification settings - Fork 1
/
data_construct.m
executable file
·57 lines (50 loc) · 1.2 KB
/
data_construct.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
clc, clear all
load image_0001_sift.mat
Data = features.data(1:20,:);
num(1) = size(features.data,1);
load image_0002_sift.mat
Data = [Data;features.data(1:20,:)];
num(2) = size(features.data,1);
load image_0003_sift.mat
Data = [Data;features.data(1:20,:)];
num(3) = size(features.data,1);
load image_0004_sift.mat
Data = [Data;features.data(1:20,:)];
num(4) = size(features.data,1);
num = [20,20,20,20];
n = length(num);
X = Data;
[N,d] = size(X);
G = zeros(n,N);
for i =1:1:n
if i == 1
G(i,1:num(i)) = 1;
else
G(i, sum(num(1:i-1))+1 : sum(num(1:i))) = 1;
end
end
Y = [1,0;1,0;0,1;0,1];
load image_0001_sift.mat
Data = features.data;
num(1) = size(features.data,1);
load image_0002_sift.mat
Data = [Data;features.data];
num(2) = size(features.data,1);
load image_0003_sift.mat
Data = [Data;features.data];
num(3) = size(features.data,1);
load image_0004_sift.mat
Data = [Data;features.data];
num(4) = size(features.data,1);
n = length(num);
X = Data;
[N,d] = size(X);
G = zeros(n,N);
for i =1:1:n
if i == 1
G(i,1:num(i)) = 1;
else
G(i, sum(num(1:i-1))+1 : sum(num(1:i))) = 1;
end
end
Y = [1,0;1,0;0,1;0,1];