display_matrix

From WeBWorK_wiki
(Redirected from DisplayMatrix)
Jump to navigation Jump to search

display_matrix

Description

Provides a rectangular display of a matrix object by producing the appropriate TeX code for displaying the contents.

Syntax

display_matrix($matrix_object)

Params

$matrix_object is a matrix object. See Matrix.pm and "RealMatrix.pm"

Returns

String which represents the matrix in TeX format used in math display mode.

Examples

Usually used in BEGIN_TEXT/END_TEXT blocks as

\{ display_matrix($A) \}
\{ display_matrix([ [ 1, 3], [4, 6] ]) \}
\{ display_matrix([ [ ans_rule(), ans_rule()], [ans_rule(), ans_rule()] ]) \}

Notes

Note that the order of answers inserted in the last example is across each row first. This is usually what is expected, but you can use "NAME_ANS_RULE" if more control is desired.
See Matrix.pm for matrix methods which specify display.