-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfdb_assignNames.m
More file actions
24 lines (19 loc) · 823 Bytes
/
fdb_assignNames.m
File metadata and controls
24 lines (19 loc) · 823 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
function fdb = fdb_assignNames(fdb)
indname = find(~cellfun(@isempty,fdb.name));
indnot = find(cellfun(@isempty,fdb.name));
for i=1:length(indnot)
% i
[~,ia] = intersect(fdb.checksum.fkt(indname),fdb.checksum.fkt(indnot(i)));
[~,ib] = intersect(fdb.checksum.data(indname),fdb.checksum.data(indnot(i)));
% [~,ic] = intersect(fdb.checksum.para(indname),fdb.checksum.para(indnot(i)));
if ~isempty(ia)
fdb.name{indnot(i)} = fdb.name{indname(ia(1))};
elseif ~isempty(ib)
fdb.name{indnot(i)} = fdb.name{indname(ib(1))};
% elseif ~isempty(ic)
% fdb.name{indnot(i)} = fdb.name{indname(ic(1))};
end
end
indname2 = find(~cellfun(@isempty,fdb.name));
fprintf('%i names could be assigned.\n',length(indname2)-length(indname))
fdb.info.predictor_status = 0; % outdated