convert a list, vector, array, Array, Vector, matrix or Matrix to a Vector - Maple Help

Online Help

All Products    Maple    MapleSim


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

convert/Vector - convert a list, vector, array, Array, Vector, matrix or Matrix to a Vector

Calling Sequence

convert( A, Vector, ... );

convert( A, Vector[o], ... );

Parameters

A

-

list, vector, array, Array, Vector, matrix, Matrix; expression to convert

o

-

(optional) use either row or column; specifies result orientation

...

-

options to be passed to the Vector constructor

Description

• 

The convert(A, Vector) function converts the parameter A into a Vector.

• 

The orientation of the result can be specified via the parameter o. The default orientation is column.

• 

If A is a 1-dimensional array or Array, a list, a vector or a Vector, it is simply passed directly to the Vector constructor, together with any additional options, and the orientation, o, if provided.

• 

If A is a matrix, Matrix, 2-D array or 2-D Array, its columns or rows are concatenated to form the result.  If the orientation parameter, o, is either not provided or is given as column, the columns of A are concatenated (from left to right) and a column Vector is returned.  If the orientation parameter is given as row, the rows of A are concatenated (from top to bottom) and a row Vector is returned.  Any additional parameters are passed to the Vector constructor when building the result.

• 

Alternatively, use the ArrayTools[Copy] function. The ArrayTools[Copy] function copies data from an existing Matrix, Vector, or Array (source) to another Matrix, Vector, or Array (target).

Examples

L:=1,0

L:=1,0

(1)

L1:=convertL,Vector

L1:=10

(2)

typeL,Vector

false

(3)

typeL1,Vector

true

(4)

A:=array1..4:

forito3doAi:=i2end do:printA

149`?`4

(5)

A1:=convertA,Vector,datatype=float

A1:=1.4.9.0.

(6)

typeA,Vector

false

(7)

typeA1,Vector

true

(8)

V:=linalg[vector]3,1,x,x2

V:=1xx2

(9)

V1:=convertV,Vector

V1:=1xx2

(10)

typeV,Vector

false

(11)

typeV1,Vector

true

(12)

M:=1,2,3|4,5,6

M:=142536

(13)

convertM,Vector

123456

(14)

convertM,Vectorrow

142536

(15)

See Also

Array, ArrayTools[Copy], convert, convert/vector, list, Matrix, rtable, type/Vector, Vector, vector(deprecated)


Download Help Document

Was this information helpful?



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