<< LUSolve SYMSCI Toolbox Mul >>

SYMSCI Toolbox >> SYMSCI Toolbox > Mat

Mat

create a matrix of symbolic scalars

Calling Sequence

M: Mat()
M: Mat( A )
M: Mat( b, r, c )

Arguments

A

matrix of symbolic scalars, integers, doubles, or strings

b

symbolic scalar, string

r

non-negative integer

c

non-negative integer

M

matrix of symbolic scalars

Description

Mat()

Returns an empty symbolic matrix.

Mat( A )

Returns a matrix, whose elements are taken from the matrix A.

Mat( b, r, c)

Returns a matrix with r rows and c columns.

For a symbolic scalar b all elements are set to b.

For a vector of symbolic scalars b the matrix is filled row-wise with the elements of b.

For a string b the elements are different symbols named "b" appended by an index "ij" with i = 1,..,r, j = 1,.., c.

Examples

// create (3,3)-matrix of zeros
A = %(Zeros(3,3))

// create a symbol
x = %(Sym("x"))

// create (3,4)-matrix filled with the same "x" element
B = %(Mat(x,3,4))

// create (3,4)-matrix filled with different "x_ij" elements
C = %(Mat("x_",3,4))

// create from string matrix
D = %(Mat(["a","b";"c","d"]))

// create from vector
E = %(Mat(Vec("v",10),2,5))

// clean-up
free(A); free(x); free(B); free(C); free(D); free(E);
clear A x B C D E;

See Also

Authors

Bibliography

SymEngine: C++ library for fast symbolic manipulation.


Report an issue
<< LUSolve SYMSCI Toolbox Mul >>