Mercurial > hg > ltpda
comparison m-toolbox/classes/@ssm/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.10 2010/12/22 16:11:25 ingo Exp $ | |
12 % | |
13 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
14 | |
15 function varargout = update_struct(varargin) | |
16 utils.helper.msg(utils.const.msg.MNAME, ['running ', mfilename]); | |
17 | |
18 obj_struct = varargin{1}; | |
19 struct_ver = varargin{2}; | |
20 | |
21 % get the version of the current toolbox | |
22 tbx_ver = strtok(getappdata(0, 'ltpda_version')); | |
23 | |
24 % get only the version string without the MATLAB version | |
25 struct_ver = strtok(struct_ver); | |
26 | |
27 %%%%%%%%%%%%%%%%%%%%%%% Update version '1.0 -> 1.9.1' %%%%%%%%%%%%%%%%%%%%%%% | |
28 | |
29 %%%%%%%%%%%%%%%%%%%%%%% Update version '1.9.1' ->'1.9.2' %%%%%%%%%%%%%%%%%%%%%%% | |
30 | |
31 %%%%%%%%%%%%%%%%%%%%%%% Update version '1.9.2' ->'1.9.3' %%%%%%%%%%%%%%%%%%%%%%% | |
32 | |
33 %%%%%%%%%%%%%%%%%%%%%%% Update version '1.9.3' ->'1.9.4' %%%%%%%%%%%%%%%%%%%%%%% | |
34 | |
35 %%%%%%%%%%%%%%%%%%%%%%% Update version '1.9.4' ->'2.0' %%%%%%%%%%%%%%%%%%%%%%% | |
36 | |
37 %%%%%%%%%%%%%%%%%%%%%%% Update version '2.0' ->'2.0.1' %%%%%%%%%%%%%%%%%%%%%%% | |
38 | |
39 %%%%%%%%%%%%%%%%%%%%%%% Update version '2.0.1' ->'2.1' %%%%%%%%%%%%%%%%%%%%%%% | |
40 | |
41 if utils.helper.ver2num(struct_ver) < utils.helper.ver2num('2.1') && ~strcmp(struct_ver, '1.0') | |
42 | |
43 error('### The LTPDA toolbox doesn''t support ssm objects which are created with the toolbox version lower than 2.1'); | |
44 | |
45 end | |
46 | |
47 varargout{1} = obj_struct; | |
48 end | |
49 |