0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018 function varargout = update_struct(varargin)
0019
0020 obj_struct = varargin{1};
0021 struct_ver = varargin{2};
0022
0023
0024 tbx_ver = strtok(getappdata(0, 'ltpda_version'));
0025
0026
0027 struct_ver = strtok(struct_ver);
0028
0029
0030
0031 if utils.helper.ver2num(struct_ver) < utils.helper.ver2num(tbx_ver) && ...
0032 strcmp(struct_ver, '1.0')
0033
0034 try
0035 obj_struct = rmfield(obj_struct, 'name');
0036 obj_struct = rmfield(obj_struct, 'created');
0037 catch ME
0038 disp(varargin{1});
0039 throw(addCause(ME, MException('MATLAB:LTPDA','### The struct (fsdata) above is not from version 1.0')));
0040 end
0041
0042
0043 struct_ver = '1.9.1';
0044
0045 end
0046
0047
0048
0049 if utils.helper.ver2num(struct_ver) < utils.helper.ver2num(tbx_ver) && ...
0050 strcmp(struct_ver, '1.9.1')
0051
0052
0053 try
0054 uo = unit(obj_struct.yunits);
0055 catch
0056 warning('!!! This XML file contains a fsdata object with unsupported y-units [%s]. Setting to empty.', obj_struct.yunits);
0057 obj_struct.yunits = '';
0058 end
0059
0060
0061 try
0062 uo = unit(obj_struct.xunits);
0063 catch
0064 warning('!!! This XML file contains a fsdata object with unsupported x-units [%s]. Setting to empty.', obj_struct.xunits);
0065 obj_struct.xunits = '';
0066 end
0067
0068
0069 struct_ver = '1.9.2';
0070
0071 end
0072
0073
0074
0075 if utils.helper.ver2num(struct_ver) < utils.helper.ver2num(tbx_ver) && ...
0076 strcmp(struct_ver, '1.9.2')
0077
0078
0079 struct_ver = '1.9.3';
0080
0081 end
0082
0083 varargout{1} = obj_struct;
0084