fun1 = @(x) ...
), using fzero
roots
solve
double
.
int
to
integrate or diff
to differentiate the right hand side. (Remember
in MATLAB the natural logarithm is log
and the inverse tangent function
is atan
). You may also have to simplify your answer, to confirm the results clearly.
int
):
symsum
(symbolic sum) to validate the following sums (use inf
for symprod
to evaluate the following infinite product (notice the
starting value of simplify
by specifying how many steps (the
default step is just one), because the output
could still be complicated.
When using simplify
you may have to tell matlab to try more steps
before giving up.
simplify
with many steps of simplification). you can use double
to convert symbolic
numbers to floating numbers, and use vpa
if you want to show more digits.
polar
or the parametric form in Cartesian coordinate using plot
. You have to generate a vector for the angle plot
: t = [2.^(-20:-4) 0.1:0.01:1];t = [-t(end:-1:1) t];
. (Try to see what happens
when you choose t = -1:0.01:1;
or t = linspace(-1,1,101)
). meshgrid
and contour
(choose the range of
the grid from -10 to 10 in both direction first and then refine it if you like)
x = linspace(-8,8,101); % vector for x-coordinates
y = linspace(-8,8,101); % vector for y-coordiantes
[X,Y] = meshgrid(x,y); % Get the grid points, matrices for (X,Y)
% you have to specify the contour of one single level, and have to repeat the value in the command
% "contour" like [0,0] for the zero contour
abs
for the absolute value, and choose the proper
range of the axis for the implicit plot.
axis equal
to make the aspect ration equal.
sym2poly
(you will get a vector for the coefficients of the polynomial, instead of calculating them by yourself), and then evaluate the polynomial using polyval
.
The function is plotted more accurately in which way, when evaluated as
syms z;
p = sym2poly((z-1)^13); % get the coefficients for the polynomial (z-1)^13
x = linspace(0.9,1.1,51);
% plot the data from polynomial evaluation, using the style "*" or "."