Close
Close window
vector to Vector - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Mozilla Firefox.
Maplesoft logo
Maplesoft logo

Online Help

All Products Maple MapleSim


[フレーム] [フレーム]

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

opts

-

(optional) one or more options as described below

Options

copy : truefalse

Indicates whether a new rtable should be allocated when converting from other rtable types such as Array or Matrix . The default is false, meaning that convert will attempt to provide a reference to the existing rtable instead of allocating a new one.

format : string

The option behaves identically to targetformat, but is only valid when expr is not itself a string or ByteArray.

sourceformat : string

A string corresponding to one of the file formats described in Formats . The input expr will be decoded using the specified format and the data returned as a Vector.

If the format specified is not one for which a Vector is a valid output type and no target format is specified, an error is issued.

targetformat : string

A string corresponding to one of the file formats described in Formats . The input expr will be encoded in the specified format and the encoded data returned as an Vector.

Note that this can be used in conjunction with sourceformat to decode data from a source to an arbitrary intermediate expression, then encode it as a Vector in a different format.

Any other options specified will 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

>

L1,0

L1,0

(1)
>

L1convertL,Vector

L110

(2)
>

typeL,Vector

false

(3)
>

typeL1,Vector

true

(4)
>

Aarray1..4:

>

forito3doAii2enddo:printA

149`?`4

(5)
>

A1convertA,Vector,datatype=float

A11.4.9.0.

(6)
>

typeA,Vector

false

(7)
>

typeA1,Vector

true

(8)
>

Vlinalgvector3,1,x,x2

V1xx2

(9)
>

V1convertV,Vector

V11xx2

(10)
>

typeV,Vector

false

(11)
>

typeV1,Vector

true

(12)
>

M1,2,3|4,5,6

M142536

(13)
>

convertM,Vector

123456

(14)
>

convertM,Vectorrow

142536

(15)

Compatibility

The convert/Vector command was updated in Maple 2022.

The copy, format, sourceformat and targetformat options were introduced in Maple 2022.

For more information on Maple 2022 changes, see Updates in Maple 2022 .


Download Help Document

AltStyle によって変換されたページ (->オリジナル) /