R 행렬곱 연산자 %*%

1 개요[ | ]

R %*%
  • 행렬 곱셈 연산자
2x2행렬 %*% 2x2행렬
A = matrix(c(1,2,3,4),2,2)
A
##      [,1] [,2]
## [1,]    1    3
## [2,]    2    4

E = matrix(c(1,0,0,1),2,2)
E
##      [,1] [,2]
## [1,]    1    0
## [2,]    0    1

A %*% E
##      [,1] [,2]
## [1,]    1    3
## [2,]    2    4
3x2행렬 %*% 2x3행렬
A = matrix(c(1,2,3,4,5,6),3,2)
A
##      [,1] [,2]
## [1,]    1    4
## [2,]    2    5
## [3,]    3    6

B = matrix(c(1,0,0,0,0,1),2,3)
B
##      [,1] [,2] [,3]
## [1,]    1    0    0
## [2,]    0    0    1

A %*% B
##      [,1] [,2] [,3]
## [1,]    1    0    4
## [2,]    2    0    5
## [3,]    3    0    6

2 같이 보기[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}