USF Information Science Blog

Coding and Statistics work for the University of South Florida. Completed by Alina Hagen


Module #6: Doing Math pt2

This week we continued our exploration of Linear Algebra and were introduced to Object Oriented Programing in R. We were given the following code to initialize the matrices A and B and asked to find A+B and A-B

We were then introduced to the diag() function and asked to create a matrix with the following values in the diagonal: 4,1,2,3

Finally, we were asked to recreate a 5×5 Matrix and were given the hint: use diag()

All in all, this week made much more sense than last week’s. This week I was able to visually track how matrix addition and subtraction worked while matrix multiplication might have well have been magic, to quote my Calculus professor. I feel a lot more comfortable with matrices after this week as compared to last week!

As always, Link to my Github: here

Published by


Leave a comment