Mercurial > hg > ltpda
diff m-toolbox/classes/@ltpda_nuo/copy.m @ 0:f0afece42f48
Import.
author | Daniele Nicolodi <nicolodi@science.unitn.it> |
---|---|
date | Wed, 23 Nov 2011 19:22:13 +0100 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/m-toolbox/classes/@ltpda_nuo/copy.m Wed Nov 23 19:22:13 2011 +0100 @@ -0,0 +1,28 @@ +% COPY copies all fields of the ltpda_nuo class to the new object. +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% DESCRIPTION: COPY copies all fields of the ltpda_nuo 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:05 ingo Exp $ +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +function varargout = copy(new, old, deepcopy) + + if deepcopy + obj = copy@ltpda_obj(new, old, 1); + else + obj = old; + end + + varargout{1} = obj; +end