<< VCat SYMSCI Toolbox Zeros >>

SYMSCI Toolbox >> SYMSCI Toolbox > Vec

Vec

create a symbolic vector

Calling Sequence

v = Vec()
v = Vec( a )
v = Vec( b, n )

Arguments

a

symbolic, double, or integer matrix, or symbolic set

b

string

n

non-negative integer scalar or vector

v

symbolic vector

Description

Creates a symbolic vector v. The elements of symbolic vectors are symbolic scalars (cf. Sym).

Vec()

Returns an empty vector.

Vec( a )

Returns a vector with the elements of a matrix or set a.

Vec( b, n)

For a scalar n, it returns a vector of length n, whose elements are different symbols named "b" appended by an index "1",..,"n".

For a vectorial n, it returns a vector length length(n), whose elemtents are different symbols named "b" appended by an index "n(1)",..,"n(length(n))".

Examples

// create empty vector
a = Vec()

// add some elements to vector
a = [a, Sym("5")]
a = [a, Sym("1.23")]
a = [a, Sym("x")]

// create a vector with elements x, x, x
c = Vec(Sym("x")(ones(1,3)))

// create a vector with elements x1, x2, x3, x4
d = Vec("x",4)

// create a vector from amatrix
e = Vec(Mat("a",2,3))

See Also

Authors

Bibliography

SymEngine: C++ library for fast symbolic manipulation.


Report an issue
<< VCat SYMSCI Toolbox Zeros >>