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

📄 left_mtimes.m

📁 curves ti si s a nice code.
💻 M
字号:
function n = left_mtimes(k, x)%  Helper function for mtimes.m%%  if x is a scalar, use the property that%  x * kron(A, B) = kron(x * A, B)%%  if x is a vector such that x = vec(X),%  use the property that %  kron(A, B) * x = vec(B * X * A')%kasize = size(k.a);kbsize = size(k.b);xsize = size(x);if (length(x) == 1)   n = kronMatrix(k.a * x, k.b);elseif xsize(1) == kasize(2)*kbsize(2)   try      n = zeros(kasize(1) * kbsize(1), xsize(2));      for i = 1 : xsize(2)         tmp = reshape(x(:,i), kbsize(2), kasize(2));         tmp = k.b * tmp * k.a';         n(:,i) = reshape(tmp, kbsize(1) * kasize(1),1);      end   catch      error(lasterr)   endelseif ( kbsize(2) == xsize(1) & xsize(2) == kasize(2) )   n = k.b * x * k.a';end

⌨️ 快捷键说明

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