Module 6 built on the previous module. This weeks lecture and reading were related to additional function of linear of algebra and the different expressions of them through the use of matrices. The assignment for this week thus focused on the generation and calculation of numbers through the application of matrices. My code for this week looked like this:
I was able to quickly apply the concepts we learned last week to determine sum/difference of the two provided matrices in step one. Step two asked to create a matrix containing four rows and columns that produced a diagonal of "4,2,1,3". I use the c() function to combine the numbers as the first argument and generated the following matrix:
I had some difficulty with the last step. As shown in the first screenshot, I had tried a few different inputs to manufacture the expected matrix, however could not find the right combination that would produce it. I looked in the online textbooks and online but the exact array that the assignment wanted w was not forthcoming. I could recognize the pattern but communicating that with R was difficult. A few of the attempts not shown were identical to a few sources online that shifted the pattern but R would ignore or fail to run these.
No comments:
Post a Comment