Draw the curve with parametric equations
\begin{align*}
x \amp = t\cos t\\
y \amp = t\sin t
\end{align*}
where \(0 \le t \le 20\text{.}\)
plot(x, y) receives two vectors: the first has x-coordinates of the points to be shown, the second has y-coordinates. It also connects these points by lines. So, for example,plot([1 2 5 6], [5 0.4 2 1])

plot([1 2 5 6], [5 0.4 2 1], '*')
* for each point, without connecting them.
x = 0:0.1:3; y = x.^3 .* exp(-2*x); plot(x, y)
x = 0:3 because the step size of 1 unit would make a very rough (low-resolution) plot with only four points used. The step size could be 0.01 instead: we may get smoother graph at the expense of more computations. The second line compute the y-values. Consider the following:x.^3 is required to have elementwise power operation-2*x because multiplying a vector by a scalar already works elementwise. There is no difference between -2*x and -2.*x
.* to multiply two vectors elementwise..* is not necessary but some people find x.^3.*exp(-2*x) harder to read because 3. looks like a decimal dot after 3.
x = 0:0.1:3 can be tedious, because the same step size would not work as well for the intervals \([2, 2.04]\) or for \([0, 50000]\text{.}\) The command linspace can be more convenient: linspace(a, b, n) creates a vector with n uniformly spaced numbers from a to b. Usually, 500 points are enough for a smooth plot, so one can reasonably use x = linspace(a, b, 500) for plots no matter how small or large the interval \([a, b]\) is.