By placing the following command right before the saveas one
set(gcf, 'Position', get(0, 'Screensize'))
the size of the output image is increased, in my case from 853x827 to 2134x1103, and the quality of the image is increased too. However, since my screen size is 1366x768, I don't know why the size is set to 2134x1103.
another option is to use the export_fig toolbox
export_fig test.png -m2
where -m2 produces an image double the size (in pixels) of the on screen figure