I remember you said in an earlier post that there was not much difference between 10 and 30. Are you clearing out vector s between each run? If you are not, try doing s=0 before each loop. If you are still having trouble, post your complete m-file.
Also, one final thing: what is the purpose of doing:
% Make wave start at 0
s = s - s(1);
This introduces an artificial offset to the data. Is this required?
It's not really required. I re-ran is by doing s=0; before all the maxterms and i did get a similar amplitude range for all 3 plots. The peaks don't vary much. The question asks us to provide the peak value hence the reason for hard coding it. Is there a simple bit of code that could automatically provide it?