view core/tools/sappend.m @ 0:e9a9cd732c1e tip

first hg version after svn
author wolffd
date Tue, 10 Feb 2015 15:05:51 +0000
parents
children
line wrap: on
line source
function target = sappend(target, source)
% target = sappend(target, source)
%
% appends source to target
% target = [] or struct(), source = struct()
% 
% updates the srtuct target by adding the source strut at its end
% if target = [], it is initialised by the first struct in source


if isempty(target)
    target = source(1);
    starti = 2;
else
    starti = 1;
end

for i = starti:numel(source)
    target(end+1) = source(i);
end