Question: Please execute the following R code: set.seed(333) vector1 = sample(1:10,9,replace=TRUE) vector2 = sample(1:10,9,replace=TRUE) m1 = matrix(vector1,3,3) m2 = matrix(vector2,3,3) Now, perform a matrix multiplication m1

Please execute the following R code:

set.seed(333) vector1 = sample(1:10,9,replace=TRUE) vector2 = sample(1:10,9,replace=TRUE) m1 = matrix(vector1,3,3) m2 = matrix(vector2,3,3)

Now, perform a matrix multiplication m1 x m2 and save the result in a new matrix m3.

What is the sum of diagonal elements in the new matrix m3?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!