0001 function [begin_val, end_val] = vb_axisends_get(axisends, type_tag, axis_tag)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035 if ~exist('axisends', 'var'), axisends = []; end;
0036 if ~exist('type_tag', 'var'), type_tag = []; end;
0037 if ~exist('axis_tag', 'var'), axis_tag = []; end;
0038 [axisends, type_tag, axis_tag] = ...
0039 inner_check_arguments(axisends, type_tag, axis_tag);
0040
0041
0042
0043 begin_val = [];
0044 end_val = [];
0045
0046 switch type_tag
0047 case 'ORIGINAL'
0048 switch axis_tag
0049 case 'X'
0050 if ~isfield(axisends, 'original_x')
0051 error('there is not original_x field');
0052 end;
0053 begin_val = axisends.original_x.begin;
0054 end_val = axisends.original_x.end;
0055 case 'Y'
0056 if ~isfield(axisends, 'original_y')
0057 error('there is not original_y field');
0058 end;
0059 begin_val = axisends.original_y.begin;
0060 end_val = axisends.original_y.end;
0061 end
0062
0063 case 'SLIDER'
0064 switch axis_tag
0065 case 'X'
0066 if ~isfield(axisends, 'slider_x')
0067 error('there is not slider_x field');
0068 end;
0069 begin_val = axisends.slider_x.begin;
0070 end_val = axisends.slider_x.end;
0071 case 'Y'
0072 if ~isfield(axisends, 'slider_y')
0073 error('there is not slider_y field');
0074 end;
0075 begin_val = axisends.slider_y.begin;
0076 end_val = axisends.slider_y.end;
0077 end
0078
0079 case 'PREVIOUS'
0080 switch axis_tag
0081 case 'X'
0082 if ~isfield(axisends, 'previous_x')
0083 error('there is not previous_x field');
0084 end;
0085 begin_val = axisends.previous_x.begin;
0086 end_val = axisends.previous_x.end;
0087 case 'Y'
0088 if ~isfield(axisends, 'previous_y')
0089 error('there is not previous_y field');
0090 end;
0091 begin_val = axisends.previous_y.begin;
0092 end_val = axisends.previous_y.end;
0093 end
0094 end
0095
0096
0097
0098
0099
0100 function [axisends, type_tag, axis_tag] = ...
0101 inner_check_arguments(axisends, type_tag, axis_tag)
0102
0103 if isempty(axisends), error('axisends is a required parameter'); end;
0104 if isempty(type_tag), error('type_tag is a required parameter'); end;
0105 if isempty(axis_tag), error('axis_tag is a required parameter'); end;
0106
0107 type_tag = upper(type_tag);
0108 axis_tag = upper(axis_tag);
0109
0110 if ~strcmp(type_tag, 'ORIGINAL') ...
0111 && ~strcmp(type_tag, 'SLIDER') ...
0112 && ~strcmp(type_tag, 'PREVIOUS')
0113 error('unknown type_tag : %s', type_tag);
0114 end
0115
0116 if ~strcmp(axis_tag, 'X') && ~strcmp(axis_tag, 'Y')
0117 error('unknown axis_tag : %s', axis_tag);
0118 end
0119
0120
0121
0122