If you ask me, this is just another poorly worded assignment. If x is a 100 element linear ramp from 0 to 10, then how is it implied that the plot starts on x = 0.01? We know the properties of logarithms, but nothing in the problem statement specifies that x starts at 0.01. The first two elements of x are 0 and ~0.101. So which is it? Should the x vector start at 0.01, or should it be defined as stated?
... or is x supposed to be a linear ramp from 0 to 1 instead?
I'm bothered enough that I'm going to throw down some guesswork. You'll have to decide what's intended and edit accordingly.
x = linspace(1/npoints,10,npoints);
y1 = exp(-0.25*x).*sin(3*x);
h1 = semilogx(x,y1,'b','linewidth',2); hold on
y2 = exp(-0.25*x).*cos(3*x);
h2 = semilogx(x,y2,'r--','linewidth',3);
legend([h1 h2],{'the first thing','some other thing'},'location','northeast')
title('Super Important Data')
y1 = exp(-0.25*x).*sin(3*x);
h1 = semilogx(x,y1,'b','linewidth',2); hold on
y2 = exp(-0.25*x).*cos(3*x);
h2 = semilogx(x,y2,'r--','linewidth',3);
legend([h1 h2],{'the first thing','some other thing'},'location','southwest')
title('Super Important Data')