print(figure_handle,'formats','-rnumber','filename') %将图形保存为png格式,分辨率为number的(默认为72),最好指定的分辨率大一点,否则保存图形的效果较差. %Save the figure with the handle h to a PostScript file named Figure1, which can be printed later: h = figure; %指定图片打印figure handle plo
% --- Executes on button press in pushbutton5. function pushbutton5_Callback(hObject, eventdata, handles) % hObject handle to pushbutton5 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles a
localpathname为当前路径,需要保存图片的位置,根据自己的实际路径设置,usedpathname用来保存打开的文件位置,方便下次打开文件对话框以上次的路径为默认路径. global usedpathname; global localpathname; localpathname='D:\Program Files\MATLAB\R2013a\bin\毕业设计\图片\';if ~ischar(usedpathname)[filename, pathname, filterindex]