<< Subs SYMSCI Toolbox Syms >>

SYMSCI Toolbox >> SYMSCI Toolbox > Sym

Sym

create symbolic scalar or matrix of symbolic scalars

Calling Sequence

s: Sym( v )

Arguments

v

symbolic scalar, string, double or integer

s

symbolic scalar, matrix of symbolic scalars

Description

Returns a symbolic scalar or matrix of symbolic scalars s with the value of v.

Other symbolic object types (set, vector, or matrix of symbolic scalars) are created using Set(..), Vec(..), or Mat(..).

Examples

// tabula rasa
reset();

// create some symbolic Scilab variables

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

// real double
y = %(Sym("2.0"))

// integer
z = %(Sym("5"))

// expression
ex = %(Sym("f(x) + x*x"))

// matrix
A = %(Sym(["1","x";"a+b","sin(x)/x+g(x)"]))

// differentiate expression y wrt. x and assign symbolic result to z
z: Diff(ex,x)

// how many symbolic objects are allocated in memory
heap()

// perform garbage collection to delete all allocated symbolic values
gc()

// symbolic variables x, y, z, and ex are still available ...
heap()

// ... we may delete them ...
free(x); free(y); free(z); free(ex);

// ... and now they are invalid, thus we clear them!
clear x y z ex A

See Also

Authors

Bibliography

SymEngine: C++ library for fast symbolic manipulation.


Report an issue
<< Subs SYMSCI Toolbox Syms >>