Previous Up Next

5.29.27  Change the order of variables: reorder

reorder takes two arguments: an expression and a vector of variable names.
reorder expands the expression according to the order of variables given as second argument.
Input:

reorder(x^2+2*x*a+a^2+z^2-x*z,[a,x,z])

Output:

a^2+2*a*x+x^2-x*z+z^2

Warning:
The variables must be symbolic (if not, purge them before calling reorder)


Previous Up Next