Description Usage Arguments Value Author(s) See Also Examples

This function is designed to print a collection of matrices, vectors, character strings and matrix expressions side by side. A typical use is to illustrate matrix equations in a compact and comprehensible way.

1 2 | ```
printMatEqn(..., space = 1, tol = sqrt(.Machine$double.eps),
fractions = FALSE)
``` |

`...` |
matrices and character operations to be passed and printed to the console. These
can include named arguments, character string operation symbols (e.g., |

`space` |
amount of blank spaces to place around operations such as |

`tol` |
tolerance for rounding |

`fractions` |
logical; if |

NULL; A formatted sequence of matrices and matrix operations is printed to the console

Phil Chalmers

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | ```
A <- matrix(c(2, 1, -1,
-3, -1, 2,
-2, 1, 2), 3, 3, byrow=TRUE)
x <- c(2, 3, -1)
# provide implicit or explicit labels
printMatEqn(AA = A, "*", xx = x, '=', b = A %*% x)
printMatEqn(A, "*", x, '=', b = A %*% x)
printMatEqn(A, "*", x, '=', A %*% x)
# compare with showEqn
b <- c(4, 2, 1)
printMatEqn(A, x=paste0("x", 1:3),"=", b)
showEqn(A, b)
# decimal example
A <- matrix(c(0.5, 1, 3, 0.75, 2.8, 4), nrow = 2)
x <- c(0.5, 3.7, 2.3)
y <- c(0.7, -1.2)
b <- A %*% x - y
printMatEqn(A, "*", x, "-", y, "=", b)
printMatEqn(A, "*", x, "-", y, "=", b, fractions=TRUE)
``` |

matlib documentation built on April 4, 2018, 5:03 p.m.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.