axis([-2 3 -.1 1.1])

fid = fopen('setprob.data');
eps = fscanf(fid,'%g',1);     fscanf(fid,'%s',1);
fclose(fid);

s = 0.5;
qtrue = 1 - 0.5*(1 - tanh(-(x-s*t)/(4*eps)))';
hold on
p = plot(x,qtrue,'b-');

h = getlegendinfo;
str1 = sprintf('Computed solution (mx = %d)',mx);
str2 = sprintf('Exact solution (mx = %d)',mx);
pos = 3;
legend([h,p],str1,str2,pos);

hold off

err1 = sum(abs(q-qtrue)) * dx;
disp(['1-norm of error = ' num2str(err1)])
errmax = max(abs(q-qtrue));
disp(['max-norm of error = ' num2str(errmax)])

clear afterframe;
