Difference between revisions of "Display matrix"

From WeBWorK_wiki
Jump to navigation Jump to search
(changed title display)
m
Line 1: Line 1:
{{DISPLAYNAME:display_matrix}}
+
{{DISPLAYTITLE:display_matrix}}
 
===display_matrix===
 
===display_matrix===
   

Revision as of 20:10, 18 November 2009

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.