![]() |
mrdividePURPOSE
Element-size division between interval matrices (operator: ./).
SYNOPSIS
function Iout=mrdivide(I1,I2)
DESCRIPTION
Element-size division between interval matrices (operator: ./). Divides two interval matrices, I1, I2. The second parameter can be a real or a single interval. In other words, right now, the general division of interval matrices is not implemented. This supposes to invert the second parameter and the inversion of an interval matrix is far from being trivial... and is not necessary for our case. CROSS-REFERENCE INFORMATION
This function calls:
SOURCE CODE
0001 function Iout=mrdivide(I1,I2) 0002 % Element-size division between interval matrices (operator: ./). 0003 % 0004 % Divides two interval matrices, I1, I2. 0005 % The second parameter can be a real or a single interval. In other 0006 % words, right now, the general division of interval matrices is not 0007 % implemented. This supposes to invert the second parameter and the inversion 0008 % of an interval matrix is far from being trivial... and is not necessary 0009 % for our case. 0010 0011 if isa(I2,'double') 0012 Iout=I1*(1/I2); 0013 else 0014 [nr2 nc2]=size(I2); 0015 if (nr2>1) || (nc2>1) 0016 error('Interval division is only implemented for one-dimensional intervals'); 0017 end 0018 0019 if (I2.lower<=0) && (I2.upper>=0) 0020 error('Division by zero in Interval division'); 0021 end 0022 0023 [nr nc]=size(I1); 0024 Iout.lower=zeros(nr,nc); 0025 Iout.upper=zeros(nr,nc); 0026 0027 I1d=isa(I1,'double'); 0028 for i=1:nr 0029 for j=1:nc 0030 if I1d 0031 v=[I1(i,j)/I2.lower I1(i,j)/I2.upper]; 0032 else 0033 v=[I1.lower(i,j)/I2.lower I1.lower(i,j)/I2.upper I1.upper(i,j)/I2.lower I1.upper(i,j)/I2.upper]; 0034 end 0035 0036 Iout.lower(i,j)=min(v); 0037 Iout.upper(i,j)=max(v); 0038 end 0039 end 0040 Iout.r=nr; 0041 Iout.c=nc; 0042 Iout=class(Iout,'Interval'); 0043 0044 end |