Mercurial > hg > ltpda
diff 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 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/m-toolbox/classes/@ssm/update_struct.m Wed Nov 23 19:22:13 2011 +0100 @@ -0,0 +1,49 @@ +% UPDATE_STRUCT update the input structure to the current ltpda version +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% FUNCTION: update_struct +% +% DESCRIPTION: UPDATE_STRUCT update the input structure to the current +% ltpda version +% +% CALL: obj_struct = update_struct(obj_struct, version_str); +% +% VERSION: $Id: update_struct.m,v 1.10 2010/12/22 16:11:25 ingo Exp $ +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +function varargout = update_struct(varargin) + utils.helper.msg(utils.const.msg.MNAME, ['running ', mfilename]); + + obj_struct = varargin{1}; + struct_ver = varargin{2}; + + % get the version of the current toolbox + tbx_ver = strtok(getappdata(0, 'ltpda_version')); + + % get only the version string without the MATLAB version + struct_ver = strtok(struct_ver); + + %%%%%%%%%%%%%%%%%%%%%%% Update version '1.0 -> 1.9.1' %%%%%%%%%%%%%%%%%%%%%%% + + %%%%%%%%%%%%%%%%%%%%%%% Update version '1.9.1' ->'1.9.2' %%%%%%%%%%%%%%%%%%%%%%% + + %%%%%%%%%%%%%%%%%%%%%%% Update version '1.9.2' ->'1.9.3' %%%%%%%%%%%%%%%%%%%%%%% + + %%%%%%%%%%%%%%%%%%%%%%% Update version '1.9.3' ->'1.9.4' %%%%%%%%%%%%%%%%%%%%%%% + + %%%%%%%%%%%%%%%%%%%%%%% Update version '1.9.4' ->'2.0' %%%%%%%%%%%%%%%%%%%%%%% + + %%%%%%%%%%%%%%%%%%%%%%% Update version '2.0' ->'2.0.1' %%%%%%%%%%%%%%%%%%%%%%% + + %%%%%%%%%%%%%%%%%%%%%%% Update version '2.0.1' ->'2.1' %%%%%%%%%%%%%%%%%%%%%%% + + if utils.helper.ver2num(struct_ver) < utils.helper.ver2num('2.1') && ~strcmp(struct_ver, '1.0') + + error('### The LTPDA toolbox doesn''t support ssm objects which are created with the toolbox version lower than 2.1'); + + end + + varargout{1} = obj_struct; +end +