MATLAB: Problem of save figures

matlab figuresaveas

hello everyone: I do have a problem to save the figure as png file. the code as following:
figName = fullfile(dirVTD,sprintf('VTD Roll = %1$d',roll));
saveas(gcf,figName);
saveas (gcf,'figName.png');
I can see matlab figure has been saved, but "png" not able to save. someone can help me out? thanks

Best Answer

saveas (gcf, [figName '.png']);