0001 function axisends = vb_axisends_set(axisends, ...
0002 type_tag, axis_tag, begin_val, end_val)
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
0036
0037 if ~exist('axisends', 'var'), axisends = []; end;
0038 if ~exist('type_tag', 'var'), type_tag = []; end;
0039 if ~exist('axis_tag', 'var'), axis_tag = []; end;
0040 if ~exist('begin_val', 'var'), begin_val = []; end;
0041 if ~exist('end_val', 'var'), end_val = []; end;
0042 [axisends, type_tag, axis_tag, begin_val, end_val] = ...
0043 inner_check_arguments(axisends, type_tag, axis_tag, begin_val, end_val);
0044
0045
0046
0047 switch type_tag
0048 case 'ORIGINAL'
0049 switch axis_tag
0050 case 'X'
0051 axisends.original_x.begin = begin_val;
0052 axisends.original_x.end = end_val;
0053 case 'Y'
0054 axisends.original_y.begin = begin_val;
0055 axisends.original_y.end = end_val;
0056 end
0057
0058 case 'SLIDER'
0059 switch axis_tag
0060 case 'X'
0061 axisends.slider_x.begin = begin_val;
0062 axisends.slider_x.end = end_val;
0063 case 'Y'
0064 axisends.slider_y.begin = begin_val;
0065 axisends.slider_y.end = end_val;
0066 end
0067
0068 case 'PREVIOUS'
0069 switch axis_tag
0070 case 'X'
0071 axisends.previous_x.begin = begin_val;
0072 axisends.previous_x.end = end_val;
0073 case 'Y'
0074 axisends.previous_y.begin = begin_val;
0075 axisends.previous_y.end = end_val;
0076 end
0077 end
0078
0079
0080
0081
0082
0083 function [axisends, type_tag, axis_tag, begin_val, end_val] = ...
0084 inner_check_arguments(axisends, type_tag, axis_tag, begin_val, end_val)
0085
0086
0087
0088
0089 if isempty(type_tag), error('type_tag is a required parameter'); end;
0090 if isempty(axis_tag), error('axis_tag is a required parameter'); end;
0091 if isempty(begin_val), error('begin_val is a required paramter'); end;
0092 if isempty(end_val), error('end_val is a required paramter'); end;
0093
0094 if begin_val > end_val
0095 tmp_begin_val = begin_val;
0096 begin_val = end_val;
0097 end_val = tmp_begin_val;
0098 end
0099
0100 type_tag = upper(type_tag);
0101 axis_tag = upper(axis_tag);
0102
0103 if ~strcmp(type_tag, 'ORIGINAL') ...
0104 && ~strcmp(type_tag, 'SLIDER') ...
0105 && ~strcmp(type_tag, 'PREVIOUS')
0106 error('unknown type_tag : %s', type_tag);
0107 end
0108
0109 if ~strcmp(axis_tag, 'X') && ~strcmp(axis_tag, 'Y')
0110 error('unknown axis_tag : %s', axis_tag);
0111 end
0112
0113
0114
0115
0116