I want to save the image in a figure directly as a 256x256 size MAT-file. However, I found that the saved MAT-file sizes were different, and when using imagesc
to display the image, it seemed to be a little different from the original image. I will show my code and hope someone could help me to solve it.
spectrogram(x,window,L,N,fs);
set(gcf,'position',[500,500,205,205]);
set(gca,'Position',[0 0 1 1]);
f=getframe(gcf);
mat=getimage(gcf);
save(['D:\matlab\speech\mydata\cleanmat\',strcat(int2str(i)),'.mat'],'mat','-v6');