comparison m-toolbox/classes/@smodel/update_struct.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 % UPDATE_STRUCT update the input structure to the current ltpda version
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3 %
4 % FUNCTION: update_struct
5 %
6 % DESCRIPTION: UPDATE_STRUCT update the input structure to the current
7 % ltpda version
8 %
9 % CALL: obj_struct = update_struct(obj_struct, version_str);
10 %
11 % VERSION: $Id: update_struct.m,v 1.3 2009/08/31 17:10:52 ingo Exp $
12 %
13 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
14
15 function varargout = update_struct(varargin)
16
17 obj_struct = varargin{1};
18 struct_ver = varargin{2};
19
20 % get the version of the current toolbox
21 tbx_ver = strtok(getappdata(0, 'ltpda_version'));
22
23 % get only the version string without the MATLAB version
24 struct_ver = strtok(struct_ver);
25
26 %%%%%%%%%%%%%%%%%%%%%%% Update version '1.0 -> 1.9.1' %%%%%%%%%%%%%%%%%%%%%%%
27
28 if utils.helper.ver2num(struct_ver) < utils.helper.ver2num(tbx_ver) && ...
29 strcmp(struct_ver, '1.0')
30
31 struct_ver = '1.9.1';
32 end
33
34 %%%%%%%%%%%%%%%%%%%%%%% Update version '1.9.1' ->'1.9.2' %%%%%%%%%%%%%%%%%%%%%%%
35
36 if utils.helper.ver2num(struct_ver) < utils.helper.ver2num(tbx_ver) && ...
37 strcmp(struct_ver, '1.9.1')
38
39 struct_ver = '1.9.2';
40 end
41
42 %%%%%%%%%%%%%%%%%%%%%%% Update version '1.9.2' ->'1.9.3' %%%%%%%%%%%%%%%%%%%%%%%
43
44 if utils.helper.ver2num(struct_ver) < utils.helper.ver2num(tbx_ver) && ...
45 strcmp(struct_ver, '1.9.2')
46
47 struct_ver = '1.9.3';
48 end
49
50 %%%%%%%%%%%%%%%%%%%%%%% Update version '1.9.3' ->'1.9.4' %%%%%%%%%%%%%%%%%%%%%%%
51
52 if utils.helper.ver2num(struct_ver) < utils.helper.ver2num(tbx_ver) && ...
53 strcmp(struct_ver, '1.9.3')
54
55 struct_ver = '1.9.4';
56 end
57
58 %%%%%%%%%%%%%%%%%%%%%%% Update version '1.9.4' ->'2.0' %%%%%%%%%%%%%%%%%%%%%%%
59
60 if utils.helper.ver2num(struct_ver) < utils.helper.ver2num(tbx_ver) && ...
61 strcmp(struct_ver, '1.9.4')
62
63 struct_ver = '2.0';
64 end
65
66 %%%%%%%%%%%%%%%%%%%%%%% Update version '2.0' ->'2.0.1' %%%%%%%%%%%%%%%%%%%%%%%
67
68 if utils.helper.ver2num(struct_ver) < utils.helper.ver2num(tbx_ver) && ...
69 strcmp(struct_ver, '2.0')
70
71 struct_ver = '2.0.1';
72 end
73
74 %%%%%%%%%%%%%%%%%%%%%%% Update version '2.0.1' ->'2.1' %%%%%%%%%%%%%%%%%%%%%%%
75
76 if utils.helper.ver2num(struct_ver) < utils.helper.ver2num(tbx_ver) && ...
77 strcmp(struct_ver, '2.0.1')
78
79 struct_ver = '2.1';
80 end
81
82 varargout{1} = obj_struct;
83 end
84