Tensor matrix multiply
Versión 1.0.0.0 (2,58 KB) por
Oliver Woodford
Matrix multiplication over tensor arrays (i.e. arrays of matrices), with matrix transposition.
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.
Citar como
Oliver Woodford (2025). Tensor matrix multiply (https://www.mathworks.com/matlabcentral/fileexchange/61754-tensor-matrix-multiply), MATLAB Central File Exchange. Recuperado .
Compatibilidad con la versión de MATLAB
Se creó con
R14
Compatible con cualquier versión
Compatibilidad con las plataformas
Windows macOS LinuxCategorías
Más información sobre Operators and Elementary Operations en Help Center y MATLAB Answers.
Etiquetas
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Descubra Live Editor
Cree scripts con código, salida y texto formateado en un documento ejecutable.
Versión | Publicado | Notas de la versión | |
---|---|---|---|
1.0.0.0 |