comparison m-toolbox/classes/@specwin/copy.m @ 0:f0afece42f48

Import.
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Wed, 23 Nov 2011 19:22:13 +0100
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:f0afece42f48
1 % COPY makes a (deep) copy of the input specwin objects.
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3 %
4 % DESCRIPTION: COPY makes a deep copy of the input specwin objects.
5 %
6 % CALL: b = copy(a, flag)
7 %
8 % INPUTS: a - input specwin object
9 % flag - true: make a deep copy, false: return copies of handles
10 %
11 % OUTPUTS: b - copy of inputs
12 %
13 % VERSION: $Id: copy.m,v 1.14 2011/05/23 20:28:34 mauro Exp $
14 %
15 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
16
17 function varargout = copy(old, deepcopy)
18
19 if deepcopy
20 % Loop over input specwin objects
21 new = specwin.newarray(size(old));
22
23 for kk = 1:numel(old)
24 new(kk).type = old(kk).type;
25 new(kk).alpha = old(kk).alpha;
26 new(kk).psll = old(kk).psll;
27 new(kk).rov = old(kk).rov;
28 new(kk).nenbw = old(kk).nenbw;
29 new(kk).w3db = old(kk).w3db;
30 new(kk).flatness = old(kk).flatness;
31 new(kk).len = old(kk).len;
32 new(kk).levelorder = old(kk).levelorder;
33 new(kk).skip = old(kk).skip;
34
35 end
36 else
37 new = old;
38 end
39
40 varargout{1} = new;
41 end
42