%Illustration of why small step size matters
%Consider function f(x) = sin(x)+sin(8*x)
%Let's build a plot with the step size pi/4
x = 0:pi/4:2*pi;
y = sin(x) + sin(8*x);
%Now let's build a plot with step size 0.01
t = 0:0.01:2*pi;
z = sin(t) + sin(8*t);
%Here are the two plots of the SAME function together
plot(x,y,t,z)
%Note that even though we were plotting the same function,
%the green plot is very different from the blue one!