MATLAB编写回调函数(部分 更新)
来源:互联网 发布:数据分析网站有哪些 编辑:程序博客网 时间:2024/06/06 19:47
figure('menubar','none');
x=plot(t,sin(t));
grid on;
set(gca,'xlim',[0 2*pi]);
h1=uimenu('label','颜色设置');
c1=set(x,'Color','red');
c2=set(x,'Color','green');
c2=set(x,'Color','blue');
uimenu(h1,'label','红色','accelerator','R','callback',c1);
uimenu(h1,'label','绿色','accelerator','G','callback',c2);
uimenu(h1,'label','蓝色','accelerator','B','callback',c3);
x=rand(10,4);
figure;
h=uitable('data',x);
set(h,'units','normalized','position',[0.1 0.5 0.8 0.8]);
% msgbox('warning','title','warn');
% warndlg('warning');
a=inputdlg({'user name:'...
,'passward:'},...
'log in');
c=questdlg('Are you sure to close the dialog ?');
switch c,
case 'Yes'
disp('you choose yes !');
case 'No'
disp('you choose no !');
case 'Cancel'
disp('you choose cancle !');
end
a=get(handles.edit1,'String');
if isempty(a)
set(handles.edit1,'String','0');
end
guidata(hObject,handles);
a=get(handles.edit2,'String');
if isempty(a)
set(handles.edit2,'String','0');
end
guidata(hObject,handles);
a=get(handles.edit1,'String');
b=get(handles.edit2,'String');
c=str2num(a)*str2num(b);
set(handles.text3,'String',num2str(c));
guidata(hObject,handles);
a=get(handles.edit2,'String');
if isempty(a)
set(handles.edit2,'String','0');
end
guidata(hObject,handles);
h=gca;
cla(h);
set(handles.edit1,'String','10');
set(handles.edit2,'String','0');
set(handles.edit3,'String','1');
x=linspace(-5,5,50);
y=x;
for w=2:0.5:6
[X Y]=meshgrid(x,y);
Z=1/sqrt(2*pi)*w.*exp(-(X.^2+Y.^2))./2*w*w;
mesh(X,Y,Z);
axis equal;
pause(0.5);
end
a=str2num(get(handles.edit1,'String'));
b=str2num(get(handles.edit2,'String'));
c=str2num(get(handles.edit3,'String'));
x=linspace(-a,a,50);
y=linspace(-b,b,50);
w=c;
[X Y]=meshgrid(x,y);
Z=1/sqrt(2*pi)*w.*exp(-(X.^2+Y.^2))./2*w*w;
mesh(X,Y,Z);
axis equal;
h=gca;
cla(h);
set(handles.edit1,'String','0');
set(handles.edit2,'String','0');
set(handles.edit3,'String','1');
val=get(hObject,'Value');
str=get(hObject,'String');
switch str{val}
case 'peaks'
handles.current_data=handles.peaks;
case 'sphere'
handles.current_data=handles.sphere;
case 'sinc'
handles.current_data=handles.sinc;
end
guidata(hObject,handles);
+++++++++++++++++++++++++++++++++++++
h=figure;%创建一个窗口
% get(h) %获得h的所有属性
set(h,'units','normalized','menu','none',...
'Position',[0.1 0.1 0.5 0.5]); %设置h的有关属性
ha=axes;
set(ha,'parent',h,'units','normalized',...
'position',[0.1 0.1 0.8 0.8]);%注意此处为设置ha的属性
%指定其父对象为h,h不加引号
x=linspace(-8,8,1000);
y=sinc(x);
h1=line('parent',ha,'xdata',x,'ydata',y,...
'color','r');
str='bgrcmykw';
for i=1:length(str)
set(h1,'color',str(i));
pause(2);
end
h=figure('units','normalized','menu',...
'none','position',[0.1 0.1 0.5 0.5]);
ha=axes('parent',h,'units','normalized'...
,'position',[0.1 0.1 0.8 0.8]);
x=linspace(-5,5,100);
y=sinc(x);
h1=line('parent',ha,'xdata',x,...
'ydata',y,'color','r','linewidth',2);
str='dhopsx';
for i=1:length(str)
set(h1,'marker',str(i));
pause(2);
end
- MATLAB编写回调函数(部分 更新)
- 如何编写回调函数
- 编写js回调函数
- matlab 回调函数函数的使用方法
- Matlab GUI回调函数规则
- Matlab常见回调函数的意义
- 回调函数的通俗理解(持续更新中)
- php函数高级部分【回调函数】
- 回调函数编写和注重点
- Java中回调函数编写
- C++ 编写回调函数步骤
- matlab gui(二)对象(axes,line[ezplot,plot],回调函数的写法)
- matlab buttongroup switch case按钮组回调函数
- matlab的gui的回调函数的使用
- muduo库阅读(28)——Net部分:各类回调函数的定义
- Java 自定义回调函数(编写属于自己的SDK)
- 回调函数(Calling)
- 回调函数(转)
- 【Java.Spring.Core】【IoC】Bean定义的继承
- Java中的不定长参数
- jdk、tomcat、maven、mongodb环境配置
- 透过WinDBG的视角看String
- C语言结构体里的成员数组和指针
- MATLAB编写回调函数(部分 更新)
- MySQL中判断一个点是否落在多边形内
- IT囧事
- 属性动画实现翻滚的控件
- 数字证书原理
- linux系统编程
- 【机器学习基础】Logistic回归基础
- 纯c语言实现动态分配多维数组的方法
- 日子