?? left_mtimes.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 + -