<< VCat SYMSCI Toolbox Variable >>

SYMSCI Toolbox >> SYMSCI Toolbox > Value

Value

symbolic value

Calling Sequence

b: Value( a )
b: #( a )
c = Value( a )
c = #( a )

Arguments

a

symbolic object

b

symbolic variable

c

symbolic value

Description

Converts any symbolic object a to a symbolic value and returns it. This operation works in-place.

Symbolic values are deleted by the garbage collection mechanism (cf. gc(..)).

It is not advisable to assign a symbolic value directly to a Scilab variable, using the "="-operator, especially when the garbage collection mode is set to automatic. Unless, you know what you are doing.

Symbolic values are useful as return values within Scilab functions written by the user.

Examples

// tabula rasa
reset();

// manual gc mode (default)
gc(%f)

//
x = %(Sym("x")) // prefer this
y = Sym("y")    // avoid that, see below ...

// do some calculations ...
x + y
2*y + 5
x*x + x

// so far, everything worked fine, but the ":" operator does not
// allow (on purpose) a symbolic value as lhs, so the following
// will fail ...
y: x*x + x 

// furthermore, if we switch to automatic gc ...
gc(%t)

// ... even the following fails ... because "y" gets automatically
// deleted after its first usage within "x+y"
x + y
2*y + 5
x*x + x

// clean-up
gc(%f);
reset();
clear x y;

See Also

Authors

Bibliography

SymEngine: C++ library for fast symbolic manipulation.


Report an issue
<< VCat SYMSCI Toolbox Variable >>