MatrixBerryCore
updateleavesext.m
Go to the documentation of this file.
1 function SData=updateleavesext(SData,fUpdateFunc)
2 import mxberry.core.struct.getleavelist;
3 [pathList,fieldValList]=getleavelist(SData);
4 SData=struct();
5 if ~isempty(pathList)
6  [fieldValList,pathList]=cellfun(fUpdateFunc,fieldValList,...
7  pathList,'UniformOutput',false);
8  cellfun(@setSDataField,pathList,fieldValList);
9 end
10  function setSDataField(subFieldNameList,value)
11  SData=setfield(SData,subFieldNameList{:},value);
12  end
13 end
14 
function updateleavesext(in SData, in fUpdateFunc)
UPDATELEAVESEXT applies the specified function to each structure leave value and returns the updated ...
function getleavelist(in SInp)
GETLEAVELIST generates a list of structure leave paths.
function setSDataField(in subFieldNameList, in value)