<< toSciCode SYMSCI Toolbox toString >>

SYMSCI Toolbox >> SYMSCI Toolbox > toSciFunction

toSciFunction

generate Scilab function from symbolic

Calling Sequence

f = toSciFunction( e )

Arguments

e

symbolic matrix

func

scilab function

Description

Generates a Scilab function f from a symbolic matrix e, which takes values for the free symbols of e as input arguments.

Examples

// symbols
Syms f g x

// symbolic expression f ...
f = (x + Sin(3*x)*Exp(-x))^int32(2)

// ... and its derivative
g = Diff(f,x)

// generate Scilab functions from f and g
ff = toSciFunction(f)
gg = toSciFunction(g)

// call them, e.g. for x=2 ...
ff(2)
gg(2)

// or use them for other purposes, e.g. plotting
t = 0:0.05:4;
plot(t, feval(t,ff), t, feval(t,gg));
legend(["f","g = df/dx"],2);

See Also

Authors

Bibliography

SymEngine: C++ library for fast symbolic manipulation.


Report an issue
<< toSciCode SYMSCI Toolbox toString >>