MTM - Maple Programming Help

Home : Support : Online Help : Connectivity : MTM Package : MTM/ccode

MTM

 ccode
 generate C code for an expression

 Calling Sequence ccode(A) ccode(A,x)

Parameters

 A - expression, Array, Matrix, or Vector of expressions x - (optional) string

Description

 • The ccode(A,x) function creates a C statement which represents the assignment of the expression A to the variable x.  This C statement is returned as a string.
 • When called with the form ccode(A), the expression A is assigned to a default variable name in the returned statement.

Examples

 > $\mathrm{with}\left(\mathrm{MTM}\right):$
 > $\mathrm{ccode}\left({x}^{4}-5{x}^{2}+2,'w'\right)$
 ${"w = pow\left(x, 0.4e1\right) - 0.5e1 * x * x + 0.2e1;"}$ (1)