COPY Make copy of tsdata objects depending of the second input %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DESCRIPTION: COPY Make copy of tsdata objects depending of the second input CALL: objs = copy(objs, [1,0]); M-FILE INFO: Get information about this methods by calling >> tsdata.getInfo('copy') VERSION: $Id: copy.m,v 1.7 2008/09/03 16:29:33 hewitson Exp $ HISTORY: 11-07-2008 Diepholz Creation %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0001 % COPY Make copy of tsdata objects depending of the second input 0002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0003 % 0004 % DESCRIPTION: COPY Make copy of tsdata objects depending of the second input 0005 % 0006 % CALL: objs = copy(objs, [1,0]); 0007 % 0008 % M-FILE INFO: Get information about this methods by calling 0009 % >> tsdata.getInfo('copy') 0010 % 0011 % VERSION: $Id: copy.m,v 1.7 2008/09/03 16:29:33 hewitson Exp $ 0012 % 0013 % HISTORY: 11-07-2008 Diepholz 0014 % Creation 0015 % 0016 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0017 0018 function varargout = copy(old, deepcopy) 0019 0020 0021 if deepcopy 0022 s = size(old); 0023 obj(s(1),s(2)) = tsdata; 0024 for kk=1:numel(old) 0025 utils.helper.msg(utils.const.msg.OPROC2, 'copying tsdata'); 0026 obj(kk).fs = old(kk).fs; 0027 obj(kk).nsecs = old(kk).nsecs; 0028 obj(kk).xunits = old(kk).xunits; 0029 obj(kk).yunits = old(kk).yunits; 0030 obj(kk).x = old(kk).x; 0031 obj(kk).y = old(kk).y; 0032 % copy time object 0033 obj(kk).t0 = copy(old(kk).t0, 1); 0034 % reset on copy 0035 obj(kk).version = tsdata.VEROUT; 0036 end 0037 else 0038 obj = old; 0039 end 0040 varargout{1} = obj; 0041 end 0042