Home > classes > @pzmodel > copy.m

copy

PURPOSE ^

COPY Make copy of pzmodel objects depending of the second input

SYNOPSIS ^

function varargout = copy(old, deepcopy)

DESCRIPTION ^

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

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

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

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

 VERSION:     $Id: copy.m,v 1.7 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 pzmodel objects depending of the second input
0002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0003 %
0004 % DESCRIPTION: COPY Make copy of pzmodel 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 %              >> pzmodel.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   if deepcopy
0021     t0   = time;
0022     prov = provenance;
0023     s = size(old);
0024     obj(s(1),s(2)) = pzmodel;
0025     for kk=1:numel(old)
0026       utils.helper.msg(utils.const.msg.OPROC2, 'copying %s', old(kk).name);
0027       obj(kk).gain  = old(kk).gain;
0028       if ~isempty(old(kk).poles)
0029         obj(kk).poles = copy(old(kk).poles,1);
0030       else
0031         obj(kk).poles = [];
0032       end
0033       if ~isempty(old(kk).zeros)
0034         obj(kk).zeros = copy(old(kk).zeros,1);
0035       else
0036         obj(kk).zeros = [];
0037       end
0038       obj(kk).hist  = old(kk).hist;
0039       obj(kk).name  = old(kk).name;
0040       obj(kk).created  = t0;
0041       obj(kk).creator  = prov;
0042       obj(kk).version  = pzmodel.VEROUT;
0043     end
0044   else
0045     obj = old;
0046   end
0047   varargout{1} = obj;
0048 end
0049 
0050

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