![]() |
mtimesPURPOSE
Product of two interval matrices (operator: *).
SYNOPSIS
function Iout=mtimes(I1,I2)
DESCRIPTION
Product of two interval matrices (operator: *). Product of two interval matrices, I1, I2. It accepts mixed real/interval matrices as inputs. CROSS-REFERENCE INFORMATION
This function calls:
SOURCE CODE
0001 function Iout=mtimes(I1,I2) 0002 % Product of two interval matrices (operator: *). 0003 % 0004 % Product of two interval matrices, I1, I2. 0005 % It accepts mixed real/interval matrices as inputs. 0006 0007 [nr nc1]=size(I1); 0008 [nr2 nc]=size(I2); 0009 if nc1~=nr2 0010 Iout=I1.*I2; 0011 else 0012 Iout.lower=zeros(nr,nc); 0013 Iout.upper=zeros(nr,nc); 0014 0015 I1d=isa(I1,'double'); 0016 I2d=isa(I2,'double'); 0017 0018 for i=1:nr 0019 for j=1:nc 0020 s_min=0; 0021 s_max=0; 0022 0023 for k=1:nc1 0024 if I1d 0025 v=[I1(i,k)*I2.lower(k,j) I1(i,k)*I2.upper(k,j)]; 0026 else 0027 if I2d 0028 v=[I1.lower(i,k)*I2(k,j) I1.upper(i,k)*I2(k,j)]; 0029 else 0030 v=[I1.lower(i,k)*I2.lower(k,j) I1.lower(i,k)*I2.upper(k,j) I1.upper(i,k)*I2.lower(k,j) I1.upper(i,k)*I2.upper(k,j)]; 0031 end 0032 end 0033 s_min=s_min+min(v); 0034 s_max=s_max+max(v); 0035 end 0036 Iout.lower(i,j)=s_min; 0037 Iout.upper(i,j)=s_max; 0038 end 0039 end 0040 Iout.r=nr; 0041 Iout.c=nc; 0042 Iout=class(Iout,'Interval'); 0043 end |