LAB100
Week 22: Operations with Matrices
Your aim for this workshop is to learn how to do matrix computations using R. Upon completing this workshop you should be able to:
-
•
Perform element-wise calculations
-
•
Perform matrix multiplication
In this workshop you will be using the following matrices.
-
A <- matrix( c(1,-3,2,-5,1,2,2,3,-4), ncol=3, nrow=3, byrow=FALSE )
-
B <- matrix( c(10,6,8,16,8,12,17,9,14), ncol=3, nrow=3, byrow=FALSE )
-
C <- matrix( c(1,-4,5,2,-3,-6), ncol=3, nrow=2, byrow=FALSE )
-
D <- matrix( c(8,7,8,14,1,-4), ncol=2, nrow=3, byrow=FALSE )
-
E <- matrix( c(2,2,2,2), ncol=2, nrow=2, byrow=FALSE )
Remember that you need to change the working directory and open a new R script at the start of each workshop.