convert/matrix - Maple Programming Help

# Online Help

###### All Products    Maple    MapleSim

Home : Support : Online Help : Programming : Data Types : Conversion : convert/matrix

convert/matrix

convert an array, a list of lists, or a Matrix to a matrix

 Calling Sequence convert(A, matrix)

Parameters

 A - two-dimensional array, list of lists, or rtable-based Matrix

Description

 • The convert(A, matrix) calling sequence converts any of the following objects into a matrix:
 * two-dimensional array
 * list of lists
 * rtable-based Matrix
 • Note: The command matrix has been superseded by Matrix.

Examples

 > $A≔\mathrm{array}\left(0..1,-1..0,\left[\left[1,2\right],\left[3,4\right]\right]\right)$
 ${A}{:=}{\mathrm{ARRAY}}{}\left(\left[{0}{..}{1}{,}{-}{1}{..}{0}\right]{,}\left[\left({0}{,}{-}{1}\right){=}{1}{,}\left({0}{,}{0}\right){=}{2}{,}\left({1}{,}{-}{1}\right){=}{3}{,}\left({1}{,}{0}\right){=}{4}\right]\right)$ (1)
 > $\mathrm{convert}\left(A,\mathrm{matrix}\right)$
 $\left[\begin{array}{rr}{1}& {2}\\ {3}& {4}\end{array}\right]$ (2)
 > $M≔\mathrm{Matrix}\left(3,3,\left[\left[1,1,1\right],\left[1,2,3\right],\left[7,8,9\right]\right]\right)$
 ${M}{:=}\left[\begin{array}{rrr}{1}& {1}& {1}\\ {1}& {2}& {3}\\ {7}& {8}& {9}\end{array}\right]$ (3)
 > $\mathrm{type}\left(M,\mathrm{matrix}\right)$
 ${\mathrm{false}}$ (4)
 > $\mathrm{type}\left(M,\mathrm{Matrix}\right)$
 ${\mathrm{true}}$ (5)
 > $\mathrm{M1}≔\mathrm{convert}\left(M,\mathrm{matrix}\right)$
 ${\mathrm{M1}}{:=}\left[\begin{array}{rrr}{1}& {1}& {1}\\ {1}& {2}& {3}\\ {7}& {8}& {9}\end{array}\right]$ (6)
 > $\mathrm{type}\left(\mathrm{M1},\mathrm{matrix}\right)$
 ${\mathrm{true}}$ (7)
 > $\mathrm{type}\left(M,\mathrm{Matrix}\right)$
 ${\mathrm{true}}$ (8)
 > $\mathrm{type}\left(\mathrm{M1},\mathrm{Matrix}\right)$
 ${\mathrm{false}}$ (9)

 See Also

## Was this information helpful?

 Please add your Comment (Optional) E-mail Address (Optional) What is ? This question helps us to combat spam