Symbolic Math Toolbox | Search  Help Desk | |
fortran | Examples | See Also |
Fortran representation of a symbolic expression.
fortran(S)
fortran(S)
returns the Fortran code equivalent to the expression S
.
The statements
syms x f = taylor(log(1+x)); fortran(f)return
t0 = x-x**2/2+x**3/3-x**4/4+x**5/5The statements
H = sym(hilb(3)); fortran(H)return
H(1,1) = 1 H(1,2) = 1.E0/2.E0 H(1,3) = 1.E0/3.E0 H(2,1) = 1.E0/2.E0 H(2,2) = 1.E0/3.E0 H(2,3) = 1.E0/4.E0 H(3,1) = 1.E0/3.E0 H(3,2) = 1.E0/4.E0 H(3,3) = 1.E0/5.E0
ccode
, latex
, pretty