MatrixBerryCore
structapplypath.m
Go to the documentation of this file.
1 function structB=structapplypath(structB,path,value)
2 
3 if ~isempty(path)
4  if path(1)=='.'
5  path=['tmp' path];
6  end
7  pathParts=regexp(path,'([^\.]*)','match');
8  pathParts=pathParts(2:end);
9  % nParts=length(pathParts);
10  % smallPath='';
11  % for iPart=2:nParts
12  % smallPath=[smallPath '.' pathParts{iPart}];
13  % end
14  % eval(['structB' smallPath '=value;']);
15  structB=setfield(structB, pathParts{:},value);
16 end
function structapplypath(in structB, in path, in value)
STRUCTAPPLYPATH for given a path '.a.b.c.d.' and a value and a structB, returns modified structB...