Symbolic Math Toolbox |
|
Obsolete Functions
This version maintains some compatibility with version 1. For example, the following obsolete functions continue to be available in version 2, though you should avoid using them as future releases may not include them.
Function
|
Description
|
determ
|
Symbolic matrix determinant
|
linsolve
|
Solve simultaneous linear equations
|
eigensys
|
Symbolic eigenvalues and eigenvectors
|
singvals
|
Symbolic singular values and singular vectors
|
numeric
|
Convert symbolic matrix to numeric form
|
symop
|
Symbolic operations
|
symadd
|
Add symbolic expressions
|
symsub
|
Subtract symbolic expressions
|
symmul
|
Multiply symbolic expressions
|
symdiv
|
Divide symbolic expressions
|
sympow
|
Power of symbolic expression
|
eval
|
Evaluate a symbolic expression
|
In version 1, these functions accepted strings as arguments and returned strings as results. In version 2, they accept either strings or symbolic objects as input arguments and produce symbolic objects as results. Version 2 provides overloaded MATLAB operators or new functions that you can use to replace most of these functions in your existing code.
For example, the version 1 statements
f = '1/(5+4*cos(x))'
g = int(int(diff(f,2)))
e = symsub(f,g)
simple(e)
continue to work in version 2. However, with version 2, the preferred approach is
syms x
f = 1/(5+4*cos(x))
g = int(int(diff(f,2)))
e = f - g
simple(e)
The version 1 statements
H = sym(hilb(3))
I = sym(eye(3))
X = linsolve(H,I)
t = sym(0)
for j = 1:3
t = symadd(t,sym(X,j,j))
end
t
continue to work in version 2. However, the preferred approach is
H = sym(hilb(3))
I = eye(3)
X = H\I
t = sum(diag(X))
You can no longer use the sym
function in this way.
M = sym(3,3,'1/(i+j-t)')
Instead, you must change the code to something like this
syms t
[J,I] = meshgrid(1:3)
M = 1./(I+J-t)
As in version 1, you can supply diff
, int
, solve,
and dsolve
with string arguments in version 2. In version 2, however, these functions return symbolic objects instead of strings.
For some computations, the new release of Maple produces results in a different format.
For example, with version 1, the statement
[x,y] = solve('x^2 + 2*x*y + y^2 = 4', 'x^3 + 4*y^3 = 1')
produces
x =
[ -RootOf(_Z^3-2*_Z^2-4*_Z-3)-2]
[-RootOf(3*_Z^3+6*_Z^2-12*_Z+7)+2]
y =
[ RootOf(_Z^3-2*_Z^2-4*_Z-3)]
[RootOf(3*_Z^3+6*_Z^2-12*_Z+7)]
The same statement works in version 2, but produces results with the RootOf
expressions expanded to exhibit the multiple solutions.
 | Compatibility Guide | |