Home > classes > @xyzdata > copy.m

copy

PURPOSE ^

COPY Make copy of xyzdata objects depending of the second input

SYNOPSIS ^

function varargout = copy(old, deepcopy)

DESCRIPTION ^

 COPY Make copy of xyzdata objects depending of the second input
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

 DESCRIPTION: COPY Make copy of xyzdata objects depending of the second input

 CALL:        objs = copy(objs, [1,0]);

 M-FILE INFO: Get information about this methods by calling
              >> xyzdata.getInfo('copy')

 VERSION:     $Id: copy.m,v 1.6 2008/09/03 16:29:33 hewitson Exp $

 HISTORY:     11-07-2008 Diepholz
                 Creation

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % COPY Make copy of xyzdata objects depending of the second input
0002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0003 %
0004 % DESCRIPTION: COPY Make copy of xyzdata 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 %              >> xyzdata.getInfo('copy')
0010 %
0011 % VERSION:     $Id: copy.m,v 1.6 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   if deepcopy
0021     ps = properties('xyzdata');
0022     s  = size(old);
0023     obj(s(1),s(2)) = xyzdata;
0024     for kk=1:numel(old)
0025       utils.helper.msg(utils.const.msg.OPROC2, 'copying xyzdata');
0026       for jj=1:length(ps)
0027         obj(kk).(ps{jj}) = old(kk).(ps{jj});
0028       end
0029       % reset on copy
0030       obj(kk).version = xyzdata.VEROUT;
0031     end
0032   else
0033     obj = old;
0034   end
0035   varargout{1} = obj;
0036 end
0037

Generated on Mon 08-Sep-2008 13:18:47 by m2html © 2003