?? ex11_1.m
字號:
screen=get(0,'ScreenSize');
W=screen(3);H=screen(4);
figure('Color',[1,1,1],'Position',[0.2*H,0.2*H,0.5*W,0.3*H],...
'Name','圖形演示系統','NumberTitle','off','MenuBar','none');
%定義Plot菜單項
hplot=uimenu(gcf,'Label','&Plot');
uimenu(hplot,'Label','Sine Wave','Call',...
['t=-pi:pi/20:pi;','plot(t,sin(t));',...
'set(hgon,''Enable'',''on'');',...
'set(hgoff,''Enable'',''on'');',...
'set(hbon,''Enable'',''on'');',...
'set(hboff,''Enable'',''on'');']);
uimenu(hplot,'Label','Cosine Wave','Call',...
['t=-pi:pi/20:pi;','plot(t,cos(t));',...
'set(hgon,''Enable'',''on'');',...
'set(hgoff,''Enable'',''on'');',...
'set(hbon,''Enable'',''on'');',...
'set(hboff,''Enable'',''on'');']);
%定義Option菜單項
hoption=uimenu(gcf,'Label','&Option');
hgon=uimenu(hoption,'Label','&Grig on',...
'Call','grid on','Enable','off');
hgoff=uimenu(hoption,'Label','&Grig off',...
'Call','grid off','Enable','off');
hbon=uimenu(hoption,'Label','&Box on',...
'separator','on','Call','box on','Enable','off');
hboff=uimenu(hoption,'Label','&Box off',...
'Call','box off','Enable','off');
hwincor=uimenu(hoption,'Label','&Window Color','Separator','on');
uimenu(hwincor,'Label','&Red','Accelerator','r',...
'Call','set(gcf,''Color'',''r'');');
uimenu(hwincor,'Label','&Blue','Accelerator','b',...
'Call','set(gcf,''Color'',''b'');');
uimenu(hwincor,'Label','&Yellow','Call',...
'set(gcf,''Color'',''y'');');
uimenu(hwincor,'Label','&White','Call',...
'set(gcf,''Color'',''w'');');
%定義Quit菜單項
uimenu(gcf,'Label','&Quit','Call','close(gcf)');
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -