Imagine I want to print/save a matlab figure into disk. May be I want to save it in PNG format. How do I do that?
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
file_handler=figure;
plot(randn(10,1));
print(file_handler,'-dpng', 'my_file_name.png');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Check your current folder. A file named my_file_name.png should be there!
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
file_handler=figure;
plot(randn(10,1));
print(file_handler,'-dpng', 'my_file_name.png');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Check your current folder. A file named my_file_name.png should be there!
No comments:
Post a Comment