20251103
This commit is contained in:
1 parent
7d58efea2f
commit
7c647fa9e0
16 files changed
+487
No files matched your search
+24
@@ -0,0 +1,24 @@
|
|||||||
|
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.5*H],'Name','图形演示系统','NumberTitle','off','MenuBar','none');
|
||||||
|
hplot=uimenu(gcf,'text','&Plot');
|
||||||
|
uimenu(hplot,'text','Sine Wave','Callback',...
|
||||||
|
['t=-pi:pi/20:pi;','plot(t,sin(t));'...
|
||||||
|
'set(hgon,''Enable'',''on'');','set(hgoff,''Enable'',''on'');'...
|
||||||
|
'set(hbon,''Enable'',''on'');','set(hboff,''Enable'',''off'');']);
|
||||||
|
uimenu(hplot,'text','Cosine Wave','Callback',...
|
||||||
|
['t=-pi:pi/20:pi;','plot(t,cos(t));'...
|
||||||
|
'set(hgon,''Enable'',''on'');','set(hgoff,''Enable'',''on'');'...
|
||||||
|
'set(hbon,''Enable'',''on'');','set(hboff,''Enable'',''off'');']);
|
||||||
|
% option
|
||||||
|
hoption=uimenu(gcf,'text','&Option');
|
||||||
|
hgon=uimenu(hoption,'text','&Grid on','Callback','grid on','Enable','off');
|
||||||
|
hgoff=uimenu(hoption,'text','&Grid off','Callback','grid off','Enable','off');
|
||||||
|
hbon=uimenu(hoption,'text','&Box on','Callback','box on','Enable','off');
|
||||||
|
hboff=uimenu(hoption,'text','&Box off','Callback','box off','Enable','off');
|
||||||
|
hwincor=uimenu(hoption,'text','&Window Color','Separator','on');
|
||||||
|
uimenu(hwincor,'text','&Red','Accelerator','r','Callback','set(gcf,''color'',''R'')');
|
||||||
|
uimenu(hwincor,'text','&Blue','Accelerator','b','Callback','set(gcf,''color'',''b'')');
|
||||||
|
uimenu(hwincor,'text','&Yellow','Accelerator','y','Callback','set(gcf,''color'',''y'')');
|
||||||
|
uimenu(hwincor,'text','&White','Accelerator','w','Callback','set(gcf,''color'',''w'')');
|
||||||
+11
@@ -0,0 +1,11 @@
|
|||||||
|
x=0:pi/100:2*pi;
|
||||||
|
y=2*exp(-0.5*x).*sin(2*pi*x);
|
||||||
|
h1=plot(x,y);
|
||||||
|
hc=uicontextmenu;
|
||||||
|
h1s=uimenu(hc,'Text','线形');
|
||||||
|
h1w=uimenu(hc,'Text','线宽');
|
||||||
|
uimenu(h1s,'Text','虚线','Callback','set(h1,''LineStyle'','':'');');
|
||||||
|
uimenu(h1s,'Text','实线','Callback','set(h1,''LineStyle'',''-'');');
|
||||||
|
uimenu(h1w,'Text','粗','Callback','set(h1,''LineWidth'',2);');
|
||||||
|
uimenu(h1w,'Text','细','Callback','set(h1,''LineWidth'',0.5);');
|
||||||
|
set(h1,'UIContextMenu',hc)
|
||||||
Binary file not shown.
Loaded 3 of 16 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user