function l=between_my(x,x_min,x_max,style);
% Logical function for testing that X locate between Xmin and Xmax
% (Xmin<x) & (x<Xmax),  (Xmin<=x) & (x<=Xmax) etc.
%
%Call:  l=between_my(x,x_min,x_max,[style]);
%
%            x - testing argument;
%  x_min,x_max - limits for X (min, max);
%        style - string variable which determine condition at limits:
%                'XX' - where X is symbol '1'(condition with =) or 
%                '0' (without =). Left - for MIN, right - for Max. Default - '11'.
%                Example: between(x,x_min,x_max,'01') is test for
%                 (x_min<x & x<=x_max).
%            l - at quit = 1 if X locate between Xmin and Xmax.

if nargin<3
   error ('!!! The number of arguments < 3 !!!');
elseif nargin<4
   style='11';
end
if x_min>x_max
   error('!!! Min > Max !!!')
end

s1='x_min<=x';
s2='x<=x_max';
if style(1)=='0'
   s1='x_min<x';
end
if style(2)=='0'
   s2='x<x_max';
end
ss=['l=' s1 ' & ' s2 ';'];
eval(ss)
