MATLAB: Problem by saveas plot

MATLABsaveas

Hi everyone, I do not understand what I'am doing woring in saving my plot.
My code:
Temp=[num2str(vaiable), 'Myplotnumber' ,num2str(n) ,'-dpng'];
saveas(gcf,Temp);
it save the figure always with Var1Myplotnumber2.png.fig
why put matlab .fig at the end?
Thank you?

Best Answer

Thank you all so much for your help. In my case the '-dpng' ending did not work.
if I change to:
Temp=['%MyName%' ,'.png'];
saveas(gcf, Temp)
it saves png format.
BR