-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHelper_GetSpecificValue.m
64 lines (49 loc) · 1.29 KB
/
Helper_GetSpecificValue.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
58
59
60
61
62
63
function [ output_args ] = Helper_GetSpecificValue( tdb, value, output )
%Helper_GetSpecificValue get a specific .mat database, a searchvalue and
%and output, to extract certain values out of the complete database
% Helper_GetSpecificValue('textures_alle.mat', 'Zoom',
% 'textures_Zoom.mat')
% Changelog: - [07.03.11] creation
% added name and class reduction from another
% file
load(tdb)
[a,b] = size(values);
%a equals number of rows, so in this case different picures
%b equals number of different features.
cnt=1;
bla = 1;
for i=1:a
currentmatch = findstr(char(name(i)), value);
if(~isempty(currentmatch))
v(cnt,:) = values(i,:);
c(cnt,:) = name(i,:);
cl(cnt,:)= class(i,:);
cnt = cnt +1;
end
end
values = v;
name = c;
classes = cl;
%Reduce classes and name(s) because it is there four times and it's only
%needed once
cnt=0;
n = name;
c = classes;
eString = cellstr('');
bla = 1;
for i=1:a
cnt=cnt+1;
bb=bla+3;
for aa=bla+1:bb
n(aa)= eString;
c(aa)= eString;
end
bla = bla + 4;
if(bla>a)
break
end
end
name = n(1:length(name));
classes = c(1:length(name));
save (output, 'classes', 'values', 'header', 'name');
end