comparison 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
comparison
equal deleted inserted replaced
-1:000000000000 0:e9a9cd732c1e
1 function target = sappend(target, source)
2 % target = sappend(target, source)
3 %
4 % appends source to target
5 % target = [] or struct(), source = struct()
6 %
7 % updates the srtuct target by adding the source strut at its end
8 % if target = [], it is initialised by the first struct in source
9
10
11 if isempty(target)
12 target = source(1);
13 starti = 2;
14 else
15 starti = 1;
16 end
17
18 for i = starti:numel(source)
19 target(end+1) = source(i);
20 end