1function [perm]=perm(x1,x2)
2% PERM gives a vector containing all possible sums of two vectors
3% [perm]=perm(x1,x2)
4%
5% It is useful for identifying segments of trigger data.
6
7
8%	$Revision: 1.1 $
9%	$Id$
10%	Copyright (c) 1998-2003 by Alois Schloegl
11%	alois.schloegl@gmail.com
12
13
14% This program is free software; you can redistribute it and/or
15% modify it under the terms of the GNU General Public License
16% as published by the Free Software Foundation; either version 2
17% of the  License, or (at your option) any later version.
18%
19% This program is distributed in the hope that it will be useful,
20% but WITHOUT ANY WARRANTY; without even the implied warranty of
21% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22% GNU General Public License for more details.
23%
24% You should have received a copy of the GNU General Public License
25% along with this program; if not, write to the Free Software
26% Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
27
28
29[r1,c1]=size(x1);
30[r2,c2]=size(x2);
31
32perm=ones(r2*c2,1)*reshape(x1,1,r1*c1)+reshape(x2,r2*c2,1)*ones(1,r1*c1);