convert/Array - Maple Programming Help

# Online Help

###### All Products    Maple    MapleSim

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

convert/Array

convert an array, Array, vector, Vector, matrix, Matrix, list, or listlist to an Array

 Calling Sequence convert( A, Array, ... );

Parameters

 A - array, Array, vector, Vector, matrix, Matrix, list, listlist; expression to convert ... - options to be passed to the Array constructor

Description

 • The convert(A, Array) function converts A into an Array. This is accomplished by passing A and any additional parameters to the Array constructor. No special order is required for the additional parameters.

Examples

 > $A≔\left[\left[1,2\right],\left[3,4\right]\right]$
 ${A}{≔}\left[\left[{1}{,}{2}\right]{,}\left[{3}{,}{4}\right]\right]$ (1)
 > $\mathrm{A1}≔\mathrm{convert}\left(A,\mathrm{Array}\right)$
 ${\mathrm{A1}}{≔}\left[\begin{array}{rr}{1}& {2}\\ {3}& {4}\end{array}\right]$ (2)
 > $\mathrm{type}\left(A,\mathrm{Array}\right)$
 ${\mathrm{false}}$ (3)
 > $\mathrm{type}\left(\mathrm{A1},\mathrm{Array}\right)$
 ${\mathrm{true}}$ (4)
 > $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]$ (5)
 > $\mathrm{M1}≔\mathrm{convert}\left(M,\mathrm{Array},\mathrm{datatype}=\mathrm{float}\right)$
 ${\mathrm{M1}}{≔}\left[\begin{array}{ccc}{1.}& {1.}& {1.}\\ {1.}& {2.}& {3.}\\ {7.}& {8.}& {9.}\end{array}\right]$ (6)
 > $\mathrm{type}\left(M,\mathrm{Array}\right)$
 ${\mathrm{false}}$ (7)
 > $\mathrm{type}\left(\mathrm{M1},\mathrm{Array}\right)$
 ${\mathrm{true}}$ (8)
 > $\mathrm{LL}≔\left[\left[1,2\right],\left[-3,4\right]\right]$
 ${\mathrm{LL}}{≔}\left[\left[{1}{,}{2}\right]{,}\left[{-}{3}{,}{4}\right]\right]$ (9)
 > $\mathrm{LL1}≔\mathrm{convert}\left(\mathrm{LL},\mathrm{Array},\mathrm{datatype}=\mathrm{float},-3..-4,-5..-4,\mathrm{order}=\mathrm{C_order}\right)$
 ${\mathrm{LL1}}{≔}{\mathrm{Array}}{}\left({-}{3}{..}{-}{4}{,}{-}{5}{..}{-}{4}{,}\left\{{}\right\}{,}{\mathrm{datatype}}{=}{\mathrm{float}}{[}{8}{]}{,}{\mathrm{order}}{=}{\mathrm{C_order}}\right)$ (10)
 > $\mathrm{type}\left(\mathrm{LL},\mathrm{Array}\right)$
 ${\mathrm{false}}$ (11)
 > $\mathrm{type}\left(\mathrm{LL1},\mathrm{Array}\right)$
 ${\mathrm{true}}$ (12)
 > $\mathrm{ArrayDims}\left(\mathrm{LL1}\right)$
 ${-}{3}{..}{-}{4}{,}{-}{5}{..}{-}{4}$ (13)
 > $\mathrm{ArrayOptions}\left(\mathrm{LL1}\right)$
 ${\mathrm{datatype}}{=}{\mathrm{float}}{[}{8}{]}{,}{\mathrm{storage}}{=}{\mathrm{rectangular}}{,}{\mathrm{order}}{=}{\mathrm{C_order}}$ (14)
 > $\mathrm{AA}≔\left[\left[1,2\right],\left[-3,4\right]\right]$
 ${\mathrm{AA}}{≔}\left[\left[{1}{,}{2}\right]{,}\left[{-}{3}{,}{4}\right]\right]$ (15)
 > $\mathrm{AA1}≔\mathrm{convert}\left(\mathrm{AA},\mathrm{Array},\mathrm{datatype}=\mathrm{float},{\mathrm{band}}_{1,1},\mathrm{order}=\mathrm{C_order}\right)$
 ${\mathrm{AA1}}{≔}\left[\begin{array}{cc}{1.}& {2.}\\ {-}{3.}& {4.}\end{array}\right]$ (16)
 > $\mathrm{type}\left(\mathrm{AA},\mathrm{Array}\right)$
 ${\mathrm{false}}$ (17)
 > $\mathrm{type}\left(\mathrm{AA1},\mathrm{Array}\right)$
 ${\mathrm{true}}$ (18)
 > $\mathrm{ArrayDims}\left(\mathrm{AA1}\right)$
 ${1}{..}{2}{,}{1}{..}{2}$ (19)
 > $\mathrm{ArrayOptions}\left(\mathrm{AA1}\right)$
 ${\mathrm{datatype}}{=}{\mathrm{float}}{[}{8}{]}{,}{\mathrm{storage}}{=}{{\mathrm{band}}}_{{1}{,}{1}}{,}{\mathrm{order}}{=}{\mathrm{C_order}}$ (20)
 > $\mathrm{ArrayIndFns}\left(\mathrm{AA1}\right)$
 ${{\mathrm{band}}}_{{1}{,}{1}}$ (21)

 See Also

## Was this information helpful?

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