diff m-toolbox/classes/@tsdata/saveobj.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/@tsdata/saveobj.m	Wed Nov 23 19:22:13 2011 +0100
@@ -0,0 +1,22 @@
+% LOADOBJ is called by the load function for user objects.
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% DESCRIPTION: LOADOBJ is called by the load function for user objects.
+%              When an object is loaded from a MAT-file, the load function calls
+%              the loadobj method if the structure of the object is changed.
+%
+% VERSION:     $Id: saveobj.m,v 1.1 2011/10/05 09:52:06 ingo Exp $
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+function objs = saveobj(objs)
+  
+  % ATTENTION: We keep the meaning of t0 for backwars compatibility.
+  %            This means
+  %              - before saving, t0 = t0 + toffset
+  %              - after loading, t0 = t0 - toffset
+  for jj=1:numel(objs)
+    objs(jj) = objs(jj).setT0(objs(jj).t0 + objs(jj).toffset/1e3);
+  end
+  
+end