At_mul_Bt

At_mul_Bt(A, B)

For matrices or vectors $A$ and $B$, calculates $Aᵀ⋅Bᵀ$

Examples

  1. Calculate the matrix product of two matrices:

    julia> A = [1 2; 3 4; 5 6];
    julia> B = [7 8 9; 10 11 12];
    julia> At_mul_Bt(A, B)
    2×2 Array{Int64,2}:
    27   39
    30   42

    This example calculates the matrix product of the transpose of matrix A and the transpose of matrix B.

  2. Multiply a matrix and a vector:

    julia> A = [1 2 3; 4 5 6];
    julia> B = [7, 8, 9];
    julia> At_mul_Bt(A, B)
    3-element Array{Int64,1}:
    50
    122
    194

    It calculates the product of the transpose of matrix A and vector B.

  3. Handle edge cases with empty matrices:
    julia> A = zeros(0, 3);
    julia> B = [1, 2, 3];
    julia> At_mul_Bt(A, B)
    0-element Array{Float64,1}

    It correctly handles the case where one of the matrices is empty.

Common mistake example:

julia> A = [1 2; 3 4];
julia> B = [5, 6, 7];
julia> At_mul_Bt(A, B)
ERROR: DimensionMismatch("A has dimensions (2, 2) but B has dimensions (3,)")

In this example, the dimensions of matrices A and B are incompatible for matrix multiplication. It's important to ensure that the number of columns in A matches the number of rows in B for matrix multiplication to be valid.

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.

*Required Field
Details

Checking you are not a robot: