A_mul_Bt
A_mul_Bt(A, B)
For matrices or vectors $A$ and $B$, calculates $Aâ‹…Báµ€$
Examples
julia> A = [1 2 3; 4 5 6];
B = [7 8; 9 10; 11 12];
julia> A_mul_Bt(A, B)
2×2 Array{Int64,2}:
58 64
139 154
-
Multiply a matrix with a transposed matrix:
julia> A = [1 2 3; 4 5 6]; julia> B = [7 8; 9 10; 11 12]; julia> A_mul_Bt(A, B) 2×2 Array{Int64,2}: 58 64 139 154
This example multiplies matrix
A
with the transpose of matrixB
. -
Multiply a vector with a transposed matrix:
julia> A = [1, 2, 3]; julia> B = [4 5 6]; julia> A_mul_Bt(A, B) 1×1 Array{Int64,2}: 32
It calculates the dot product of vector
A
with the transpose of matrixB
. - Multiply a row vector with a column vector:
julia> A = [1 2 3]; julia> B = [4, 5, 6]; julia> A_mul_Bt(A, B) 1×1 Array{Int64,2}: 32
This example demonstrates the multiplication of a row vector (
A
) with a column vector (B
).
Common mistake example:
julia> A = [1 2 3; 4 5 6];
julia> B = [7 8 9];
julia> A_mul_Bt(A, B)
ERROR: DimensionMismatch("A has dimensions (2,3) but B has dimensions (1,3)")
In this case, the dimensions of matrix A
and matrix B
are incompatible for multiplication. Make sure the number of columns in A
matches the number of columns in the transposed B
for a valid multiplication.
See Also
Ac_ldiv_B, Ac_ldiv_Bc, Ac_mul_B, Ac_mul_Bc, Ac_rdiv_B, Ac_rdiv_Bc, At_ldiv_B, At_ldiv_Bt, At_mul_B, At_mul_Bt, At_rdiv_B, At_rdiv_Bt, A_ldiv_Bc, A_ldiv_Bt, A_mul_B!, A_mul_Bc, A_mul_Bt, A_rdiv_Bc, A_rdiv_Bt, Bidiagonal, cond, conv2, det, diag, diagind, diagm, diff, eig, eigvals, eigvecs, expm, eye, full, inv, isdiag, ishermitian, isposdef, isposdef!, issym, istril, istriu, logabsdet, logdet, lyap, norm, qrfact, rank, repmat, rot180, rotl90, rotr90, sortrows, sqrtm, SymTridiagonal, trace, Tridiagonal, tril, tril!, triu, triu!, writedlm,User Contributed Notes
Add a Note
The format of note supported is markdown, use triple backtick to start and end a code block.