annotate aim-mat/tools/@signal/plus.asv @ 4:537f939baef0 tip

various bug fixes and changed copyright message
author Stefan Bleeck <bleeck@gmail.com>
date Tue, 16 Aug 2011 14:37:17 +0100
parents 74dedb26614d
children
rev   line source
tomwalters@0 1 % method of class @signal
tomwalters@0 2 %
tomwalters@0 3 % INPUT VALUES:
tomwalters@0 4 %
tomwalters@0 5 % RETURN VALUE:
tomwalters@0 6 %
tomwalters@0 7 %
tomwalters@0 8 % (c) 2003, University of Cambridge, Medical Research Council
tomwalters@0 9 % Stefan Bleeck (stefan@bleeck.de)
tomwalters@0 10 % http://www.mrc-cbu.cam.ac.uk/cnbh/aimmanual
tomwalters@0 11 % $Date: 2003/06/11 10:45:20 $
tomwalters@0 12 % $Revision: 1.5 $
tomwalters@0 13
tomwalters@0 14 function sig=plus(a,b)
tomwalters@0 15 % addition
tomwalters@0 16 % einfachster Fall: Addiere eine konstante Zahl
tomwalters@0 17 % sonst: Addiere ein zweites Signal zum Zeitpunkt Null
tomwalters@0 18
tomwalters@0 19 if isnumeric(b)
tomwalters@0 20 a.werte=a.werte+b;
tomwalters@0 21 sig=a;
tomwalters@0 22 return
tomwalters@0 23 end
tomwalters@0 24
tomwalters@0 25 if isobject(b)
tomwalters@0 26 % a couple of cases possible:
tomwalters@0 27 % a==b, easy
tomwalters@0 28 % a>b, add b to a
tomwalters@0 29 % b>a, add a to b
tomwalters@0 30 dur1=getlength(a);
tomwalters@0 31 dur2=getlength(b);
tomwalters@0 32 start1=getminimumtime(a);
tomwalters@0 33 start2=getminimumtime(b);
tomwalters@0 34 if dur1==dur2 && start1==start2
tomwalters@0 35 sig=add(a,b);
tomwalters@0 36 else
tomwalters@0 37 if start1+dur1>
tomwalters@0 38
tomwalters@0 39 end
tomwalters@0 40 end
tomwalters@0 41
tomwalters@0 42