Symbolic transformations can be done by specifying “syms x” keyword in front of your code. It can be commented out if x no need to be a symbolic value.
It is possible to define variables whose value is a function. In this case the function's name must be preceded by the character
to suppress evaluation. These variables can be used like the function they stand for. For example, who dislikes the built-in function realpart(x) name can shorten:
Parts of an expression may be replaced by other expressions using subst(a,b,c): a is substituted for b in c. This is a powerful function with many uses.
First, it may be used to insert numbers for variables, in the example for in der formula .
Second, one can replace a symbolic variable by a complex term. The expression is automatically updated to the canonical format. In the following example is inserted for x in .
Finally, the term b itself may be a complex expression (in the example ). jMathLab then tries to identify this expression in c (example: . This is accomplished by solving the equation a = b for the symbolic variable in b (example: ), and inserting the solution in c. This does not always succeed, or there may be several solutions, which are returned as a vector.
The function trigrat(expression) applies a series of algorithms to expression.
It is often required to apply float(expression) to the final result.
And with 2 variables, x,y
trigexpand(expression) expands trigonometric expressions to complex exponentials. It is the first step of the function trigrat above.