x = [0.0:0.01:2.0*pi];
y = sin(x);
plot(x,y);

% texttit = sprintf('%s\n','This title');
% texttit = sprintf('%s%s',texttit,'contains two lines');
% title(texttit);

title({'This title';'contains two lines'});

print('figure.png','-dpng');
