Mercurial > hg > ltpda
comparison m-toolbox/classes/@tsdata/loadobj.m @ 0:f0afece42f48
Import.
author | Daniele Nicolodi <nicolodi@science.unitn.it> |
---|---|
date | Wed, 23 Nov 2011 19:22:13 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:f0afece42f48 |
---|---|
1 % LOADOBJ is called by the load function for user objects. | |
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
3 % | |
4 % DESCRIPTION: LOADOBJ is called by the load function for user objects. | |
5 % When an object is loaded from a MAT-file, the load function calls | |
6 % the loadobj method if the structure of the object is changed. | |
7 % | |
8 % VERSION: $Id: loadobj.m,v 1.7 2011/10/05 09:52:06 ingo Exp $ | |
9 % | |
10 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
11 | |
12 function objs = loadobj(objs) | |
13 | |
14 if isstruct(objs) | |
15 for kk = 1:numel(objs) | |
16 objs(kk).class = 'tsdata'; | |
17 objs(kk).tbxver = '1.0'; | |
18 end | |
19 objs = tsdata(objs); | |
20 end | |
21 | |
22 % ATTENTION: We keep the meaning of t0 for backwars compatibility. | |
23 % This means | |
24 % - before saving, t0 = t0 + toffset | |
25 % - after loading, t0 = t0 - toffset | |
26 for jj=1:numel(objs) | |
27 objs(jj).setT0(objs(jj).t0 - objs(jj).toffset/1e3); | |
28 end | |
29 | |
30 end |