标签:
Define a symbol
expr = sym(‘(x=y)^2‘)
Define symbols
syms a b c d % four symbols defined A = [a b ; c d ] % A is also a symbol det(A) % symbolic computation of determinant
Factor and expand
factor(sym(‘x^2 - y^2‘)) expand(sym(‘(x-y)^2‘)
Limits
limit(f, x, a) limit(f, x, a, ‘left‘) limit(f, x, a, ‘right‘)
Differentiation
diff(f, x, n) % default value of n is 1
Integration
int(f, x) % indefinite integral int(f, x, a, b) % integral over interval [a, b]
Fourier transform
fourier(fx, x, t)
ifourier(fw, t, x)
Laplace transform
laplace(fx, x, t)
ilaplace(fw, t, x)
Composition of functions
>> sym x; >> f1 = sin(x); >> f2 = cos(x); >> compose(f1, f2) ans = sin(cos(x))
Solving differential equations
>> dsolve(‘D2y + omega^2 * y == 0‘,‘x‘) ans = C4*exp(omega*x*i) + C5*exp(-omega*x*i)
>> dsolve(‘Dy + y == 0‘, ‘y(0) == 3‘, ‘x‘) % ‘x‘ as independent variable
ans =
3*exp(-x)
Contour plotting
>> syms x y; >> f = exp(-x^2 + -y^2); >> ezcontour(f, [-1 1 -1 1])
>> ezcontourf(f, [-1 1 -1 1])
Mesh plotting
ezmesh(f, [-1 1 -1 1])
>> ezmesh(@(x,y)(1+0.2*cos(y)).*cos(x), @(x,y)(1+0.2*cos(y)).*sin(x), @(x,y)0.2*sin(y), [0, 2*pi, 0, 2*pi])
ezplot(f, ...)
ezplot3(x, y, z, [tmin tmax])
ezplot3(..., ‘animate‘)
ezpolar(f)
ezpolar(f, [theta_min theta_max])
ezsuf(f)
ezsurf(f, domain)
ezsurf(x, y, z, [smin smax tmin tmax])
Matlab symbolic computation memo
标签:
原文地址:http://www.cnblogs.com/ch3cooh/p/matlab_memo.html