⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mtimes.m

📁 Interval Arithmetic Toolbox for Matlab
💻 M
字号:
function r = mtimes(a,b)

%MTIMES (interval) overloades mtimes for interval matrices, a*b.
%
%b4m - datatype interval    Version 1.02    (c) 26.2.1998 Jens Zemke
%
%   DESCRIPTION:
%     'mtimes' is called
%
%         r = a * b
%
%     or
%
%         r = mtimes(a,b)
%
%     and computes a * b for given interval/double
%     matrices a, b.
%
%     The operations on the datatype interval
%     are based on BIAS by Olaf Knueppel.
%
%   SEE ALSO:
%     interval: mrdivide, mldivide, mpower, minus, plus, uminus, uplus.
%     double: mtimes.

global b4m_DouBLe b4m_INTerval

if isa(a, 'double')    % then b must be of type interval
   if imag(a)
      error('Complex intervals are not supported.');
   elseif isa(a, 'sparse')
      error('Sparse intervals are not supported.');
   end;

   r.val = bias_mul(b4m_DouBLe, a, b4m_INTerval, b.val);

elseif isa(a, 'interval') & isa(b, 'interval')
   r.val = bias_mul(b4m_INTerval, a.val, b4m_INTerval, b.val);

elseif isa(b, 'double') % then a must be of type interval
   if imag(b)
      error('Complex intervals are not supported.');
   elseif isa(b, 'sparse')
      error('Sparse intervals are not supported.');
   end;

   r.val = bias_mul(b4m_INTerval, a.val, b4m_DouBLe, b);

else
   error(['No multiplication ''' class(a) ''' times ''' class(b) ''' possible.'])
end;

if isa(r.val, 'char')
   error(r.val);
else
   r = class(r, 'interval');
end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -