Symbolic Mathematics
Most symbolic expressions can be represented by expressions in
single quotes such as
'x ^ 2 + sin(x)'
but symbolic
matrices should be created with function sym( ), e.g.,
M = sym('[a b c; d e f]') % a 2-by-3 symbolic matrix
diff('x ^ 2 + sin(x)') % derivative of a function
diff x^2+sin(x) % the same as above; there is a space after diff,
% but no space is allowed within the expression
diff('x^3 * y^2', 'x', 2) % second-order derivative with respect to x
subs('x^3 * y^2', 'a', 'x') % substitute a for x in x^3y^2
Use int( ) for the symbolic integral and determ( )
for the determinant of a symbolic matrix.
Back to MATLAB home page