Week 6: Doing Math pt2
Week 6: Doing Math pt2 This week we covered more matrices and how to use certain functions to manipulate them. R is also already quite handy at dealing with these concepts so without further ado, I will show the entirety of my code, then its outputs in parts where I will explain either what we see, what I did or both. Okay, so now I will show the output for the first 8 lines and discuss: The first 2 lines are simply the copying and creating of the matrices used in this assignment. The first thing we were asked to do was add matrix a and matrix b, so I did just that, and stored the result in a variable called plus, which was then printed. I did the same basic idea but with subtraction for a - b stored in variable minus. I then used the diag command as was suggested by the professor to create the second matrix that was requested by the assignment instructions, storing the result in matrixOne, then printing the result to the screen for confirmation. The first thing I did to produce t...