Working on a review exercise from Van Loan's Introduction to Scientific Computation. It's P1.2.4 in case anyone wants to know. I can't figure out why my code produces a single plot.
x=linspace(0,2*pi, 30);
for k=1:5
plot(x, sin(k*x));
end
It seems like I need to do
plot(x, sin(x), x, sin(2*x), x, sin(3*x)....)
But this seems to be an excessive amount of hand coding, is there a more elegant way?