view m-toolbox/classes/@ltpda_tf/copy.m @ 52:daf4eab1a51e
database-connection-manager tip
Fix. Default password should be [] not an empty string
author
Daniele Nicolodi <nicolodi@science.unitn.it>
date
Wed, 07 Dec 2011 17:29:47 +0100 (2011-12-07)
parents
f0afece42f48
children
line source
+ − % COPY copies all fields of the ltpda_tf class to the new object.
+ − %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ − %
+ − % DESCRIPTION: COPY copies all fields of the ltpda_tf class to the new
+ − % object.
+ − %
+ − % CALL: b = copy(new, old, flag)
+ − %
+ − % INPUTS: new - new object which should be created in the sub class.
+ − % old - old object
+ − % flag - 1: make a deep copy, 0: return copies of handles
+ − %
+ − % OUTPUTS: b - copy of inputs
+ − %
+ − % VERSION: $Id: copy.m,v 1.1 2009/08/14 10:53:06 ingo Exp $
+ − %
+ − %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ −
+ − function varargout = copy(new, old, deepcopy)
+ −
+ − if deepcopy
+ − obj = copy@ltpda_uoh(new, old, 1);
+ −
+ − for kk = 1:numel(obj)
+ − %%% copy all fields of the ltpda_tf class
+ − obj(kk).iunits = copy(old(kk).iunits, 1);
+ − obj(kk).ounits = copy(old(kk).ounits, 1);
+ − end
+ −
+ − else
+ − obj = old;
+ − end
+ −
+ − varargout{1} = obj;
+ − end