Institut de Robòtica i Informàtica Industrial

power

PURPOSE ^

Element-wise power of an interval matrix (operator: .^).

SYNOPSIS ^

function Iout=power(I1,p)

DESCRIPTION ^

 Element-wise power of an interval matrix (operator: .^).

 Element by element power of an interval matrix, I1 to real an exponent, p.

CROSS-REFERENCE INFORMATION ^

This function calls:
This function is called by:

SOURCE CODE ^

0001 function Iout=power(I1,p)
0002 % Element-wise power of an interval matrix (operator: .^).
0003 %
0004 % Element by element power of an interval matrix, I1 to real an exponent, p.
0005 
0006   if isa(p,'double')
0007     if ceil(p)~=p
0008       error('Interval power only defined on integers');
0009     end
0010     if p<0
0011       error('Interval power only defined on positive exponents');
0012     end
0013     
0014     evenPower=(mod(p,2)==0);
0015        
0016     Iout.lower=zeros(I1.r,I1.c);
0017     Iout.upper=zeros(I1.r,I1.c);
0018     
0019     for i=1:I1.r
0020       for j=1:I1.c
0021         a=I1.lower(i,j).^p;
0022         b=I1.upper(i,j).^p;
0023         
0024         if (evenPower) && (I1.lower(i,j)<=0) && (I1.upper(i,j)>=0) 
0025           Iout.lower(i,j)=0;
0026         else
0027           Iout.lower(i,j)=min(a,b);
0028         end
0029         Iout.upper(i,j)=max(a,b);
0030       end
0031     end
0032     Iout.r=I1.r;
0033     Iout.c=I1.c;
0034     Iout=class(Iout,'Interval');
0035   else
0036     error('Interval power is only implemented with real exponents');
0037   end


Institut de Robòtica i Informàtica Industrial

Generated on Fri 24-Jul-2009 12:32:50 by m2html © 2003