diff m-toolbox/classes/@plist/simplify.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/@plist/simplify.m	Wed Nov 23 19:22:13 2011 +0100
@@ -0,0 +1,29 @@
+% SIMPLIFY simplifies a plist.
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% DESCRIPTION: SIMPLIFY simplifies a plist by replacing any paramValue with
+%              its default value, thus throwing away any properties,
+%              options etc. This makes copying much lighter if the plist is
+%              in a tight loop.
+%
+% CALL:        pl.simplify;
+%
+% <a href="matlab:utils.helper.displayMethodInfo('plist', 'simplify')">Parameters Description</a>
+%
+% VERSION:     $Id: simplify.m,v 1.3 2011/04/08 08:56:21 hewitson Exp $
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% 
+function varargout = simplify(varargin)
+  
+  pl = varargin{1};
+  
+  for kk=1:pl.nparams    
+    p = pl.params(kk);    
+    val = p.getVal;
+    p.setVal(val);    
+  end
+  
+end
+