Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what does %*%+ mean in matrix operations?

I read a piece of code somewhere where the following operation is performed between matrices x and y

x %*% + y

I know that %*% means matrix multiplication but what does %*% + mean? I tried it out in R and I get the same results for both.

like image 659
Amazonian Avatar asked Jul 22 '18 08:07

Amazonian


Video Answer


1 Answers

Based on precedence of operators, unary minus and plus (+, -) are evaluated before %any% (including %*%). Therefore, x %*% + y is the same as x %*% (+y) (which is equal to x %*% y).

like image 182
mt1022 Avatar answered Oct 10 '22 22:10

mt1022