generate Scilab function from symbolic
f = toSciFunction( e )
symbolic matrix
scilab function
Generates a Scilab function f from a symbolic matrix e, which takes values for the free symbols of e as input arguments.
// 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); | ![]() | ![]() |
SymEngine: C++ library for fast symbolic manipulation.