1 function c = extend_class_from_struct(classname,s)
2 %
function c = extend_class_from_struct(s)
4 %
function setting fields of a
class by corresponding fields of
6 %
for this, the
default constructor of the
string classname is
7 % called and then the member variables are copied.
9 % B. Haasdonk 1.10.2013
11 eval([
'c = ',classname,
';']);
14 setfield(c,fs{i},getfield(s,fs{i}));