获得有保存图像图标的窗口 (更改MATLAB自带的系统函数)

http://hi.baidu.com/pengjun/blog/item/2dc2cdbf84054f0218d81f4c.html

 

答案当然是有的,那么我们就需要去更改MATLAB自带的系统函数plotperf.m,好了,在命令窗口运行edit plotperf.m就可以打开该M文件了,将其中的程序更改如下:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% New figure
function fig = new_figure(name)

fig = figure(...
    'Units',          'pixel',...
    'Name',           name,...
    'Tag',            'train',...
    'NumberTitle',    'off',...
    'IntegerHandle', 'off',...
    'Toolbar',        'figure',...
    'Menubar',        'figure'
);

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Create new plot in figure
function createNewPlot(fig)

% Delete all children from figure
z = get(fig,'children');
for i=1:length(z)
    delete (z(i));
end

% Create axis
ud.TrainAxes     = axes('Parent',fig);
ud.TrainLine     = plot(0,0,0,0,0,0,0,0,'EraseMode','None','Parent',ud.TrainAxes);
ud.TrainXlabel   = xlabel('X Axis','Parent',ud.TrainAxes);
ud.TrainYlabel   = ylabel('Y Axis','Parent',ud.TrainAxes);
ud.TrainTitle    = get(ud.TrainAxes,'Title');
set(ud.TrainAxes,'yscale','log');
ud.XData      = [];
ud.YData      = [];
ud.Y2Data     = [];
set(fig,'UserData',ud,'menubar','figure','toolbar','figure');

上面只是整个函数的片段,其目的就是为画图窗口添加一个图形窗口一样的菜单栏和标题栏。之后,保存,再次运行plotperf(tr),就会得到这样的窗口:

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值