Tensor matrix multiply

Matrix multiplication over tensor arrays (i.e. arrays of matrices), with matrix transposition.
326 Downloads
Aktualisiert 24. Feb 2017

Lizenz anzeigen

C = tmult(A, B) is equivalent to:
sz = [size(B) 1];
sz(1) = size(A, 1);
C = zeros(sz);
for a = 1:prod(sz(3:end))
C(:,:,a) = A(:,:,a) * B(:,:,a);
end

but is completely vectorized, so much faster. Tmult also supports bsxfun-style expansion of singular dimensions where appropriate, such that tmult(rand(4, 3, 10), rand(3, 2)) yields a 4x2x10 output.

Zitieren als

Oliver Woodford (2026). Tensor matrix multiply (https://de.mathworks.com/matlabcentral/fileexchange/61754-tensor-matrix-multiply), MATLAB Central File Exchange. Abgerufen.

Kompatibilität der MATLAB-Version
Erstellt mit R14
Kompatibel mit allen Versionen
Plattform-Kompatibilität
Windows macOS Linux
Kategorien
Mehr zu Operators and Elementary Operations finden Sie in Help Center und MATLAB Answers
Version Veröffentlicht Versionshinweise
1.0.0.0