forked from gmishne/diffusion_maps
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetParams.m
More file actions
25 lines (22 loc) · 739 Bytes
/
setParams.m
File metadata and controls
25 lines (22 loc) · 739 Bytes
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
function paramsOut = setParams(dParams, paramsIn)
% paramsOut = setParams(dParams, paramsIn)
% The output params struct will include the fields of dParams and paramsIn.
% If the same field exists in both of them, the value will be taken from 'paramsIn'
paramsOut = dParams;
if isempty(paramsIn)
return;
end;
fnames = fieldnames(paramsIn);
for f=1:length(fnames)
if isfield(paramsOut, fnames{f})
if isstruct(paramsOut.(fnames{f}))
val = setParams(paramsOut.(fnames{f}), paramsIn.(fnames{f}));
else
val = paramsIn.(fnames{f});
end;
paramsOut.(fnames{f}) = val;
else
paramsOut.(fnames{f}) = paramsIn.(fnames{f});
end;
end;
return;