Rmatrixwork - > mmp< A%B performs matrix multiplication...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Matrix work in R Reading in a matrix: > m < - matrix(c(1,2,3,4,5,6),3,2) ## creates a 3 row by 2 column matrix with 1 2 3 in the ## first column and 4 5 6 in the second Matrix Multiplication: Suppose matrix A is a 2 by 3 matrix and matrix B in a 3 by 5 matrix (both stored as matrices). The 2 by 5 product matrix mmp is formed as indicated below.
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: > mmp < - A%*%B ## performs matrix multiplication Matrix inverse: Suppose matrix A is a k by k nonsingular square matrix. The k by k inverse matrix which is the multiplicative inverse of A (call it iA) can be found as follows: > iA < - solve(A) ## finds the matrix inverse...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online