1 classdef ScalarCreator < DataTree.CreatorDefault
2 % Simple
DataTree.ICreator copying the original tree and applying a custom
function to
3 % its leafs returning a scalar value.
5 % This creator is used by the INode.create_scalar_tree() method.
10 % function_handle to a custom function applied to all
leaf elements
12 % The function synopsis is: 'ret = funcptr(arg_node)'
17 function sc = ScalarCreator(funcptr)
19 % constructor of this creator
22 % funcptr: function handle to a custom function applied to all
leaf elements
26 function node = create_leaf_node(this, arg_node, basepath, mu_cube, tslice)
27 % function node = create_leaf_node(this, arg_node, basepath, mu_cube, tslice)
28 % @copybrief DataTree::
ICreatorcreate_leaf_node()
30 % @copydetails DataTree::
ICreatorcreate_leaf_node()
31 svalue = this.funcptr(arg_node);