Cross product of two matrix

How to find the cross product of two matrix

cross product,vector cross product,matrix,cross product of two matrices,cross product 3x1 matrix,cross product of two vectors,cross product of two vectors formula (3d example),cross product ti-84,cross product toll,cross product of i j k,cross product 3d vectors,cross product formula,cross product answer keys,cross product example,cross product program,vector product,cross product of three vectors

> C_mat = matrix(c(1, 2, 3, 4, 5, 7), 2, 3)
>
> D_mat = matrix(c(2, 2, 2, 2, 2, 2), 2, 3)
>
> crossprod(C_mat, D_mat)
     [,1] [,2] [,3]
[1,]    6    6    6
[2,]   14   14   14
[3,]   24   24   24
>
> t(C_mat) %*% D_mat
     [,1] [,2] [,3]
[1,]    6    6    6
[2,]   14   14   14
[3,]   24   24   24
>
> all.equal(crossprod(C_mat, D_mat), t(C_mat) %*% D_mat)
[1] TRUE
> crossprod(C_mat, C_mat)
     [,1] [,2] [,3]
[1,]    5   11   19
[2,]   11   25   43
[3,]   19   43   74
>
> t(C_mat) %*% C_mat
     [,1] [,2] [,3]
[1,]    5   11   19
[2,]   11   25   43
[3,]   19   43   74
>
> all.equal(crossprod(C_mat, C_mat), t(C_mat) %*% C_mat)
[1] TRUE

Post a Comment

0 Comments