wolffd@0: function target = sappend(target, source) wolffd@0: % target = sappend(target, source) wolffd@0: % wolffd@0: % appends source to target wolffd@0: % target = [] or struct(), source = struct() wolffd@0: % wolffd@0: % updates the srtuct target by adding the source strut at its end wolffd@0: % if target = [], it is initialised by the first struct in source wolffd@0: wolffd@0: wolffd@0: if isempty(target) wolffd@0: target = source(1); wolffd@0: starti = 2; wolffd@0: else wolffd@0: starti = 1; wolffd@0: end wolffd@0: wolffd@0: for i = starti:numel(source) wolffd@0: target(end+1) = source(i); wolffd@0: end