- 浏览: 4338496 次
- 性别:
- 来自: 湛江
博客专栏
-
SQLite源码剖析
浏览量:79478
-
WIN32汇编语言学习应用...
浏览量:68499
-
神奇的perl
浏览量:101646
-
lucene等搜索引擎解析...
浏览量:281499
-
深入lucene3.5源码...
浏览量:14636
-
VB.NET并行与分布式编...
浏览量:65712
-
silverlight 5...
浏览量:31370
-
算法下午茶系列
浏览量:45291
文章分类
最新评论
-
yoyo837:
counters15 写道目前只支持IE吗?插件的东西是跨浏览 ...
Silverlight 5 轻松开启绚丽的网页3D世界 -
shuiyunbing:
直接在前台导出方式:excel中的单元格样式怎么处理,比如某行 ...
Flex导出Excel -
di1984HIT:
写的很好~
lucene入门-索引网页 -
rjguanwen:
在win7 64位操作系统下,pygtk的Entry无法输入怎 ...
pygtk-entry -
ldl_xz:
http://www.9958.pw/post/php_exc ...
PHPExcel常用方法汇总(转载)
guidata用来保存handles结构,可以做为窗口间参数的传递。
>> help guidata
GUIDATA Store or retrieve application data.
GUIDATA(H, DATA) stores the specified data in the figure's
application data.
H is a handle that identifies the figure - it can be the figure
itself, or any object contained in the figure.
DATA can be anything an application wishes to store for later
retrieval.
DATA = GUIDATA(H) returns previously stored data, or an empty
matrix if nothing was previously stored.
GUIDATA provides application authors with a convenient interface
to a figure's application data. You can access the data from a
callback subfunction using the component's handle, without needing
to find the figure's handle. You can also avoid having to create
and maintain a hardcoded property name for the application data
throughout your source code. GUIDATA is particularly useful in
conjunction with GUIHANDLES, which returns a structure containing
handles of all the components in a GUI listed by tag.
Example:
Suppose an application creates a figure with handle F, containing
a slider and an editable text uicontrol whose tags are
'valueSlider' and 'valueEdit' respectively. The following
excerpts from the application's M-file illustrate the use of
GUIDATA to access a structure containing handles returned by
GUIHANDLES, plus additional application-specific data added during
initialization and callbacks:
... excerpt from the GUI setup code ...
f = openfig('mygui.fig');
data = guihandles(f); % initialize it to contain handles
data.errorString = 'Total number of mistakes: ';
data.numberOfErrors = 0;
guidata(f, data); % store the structure
... excerpt from the slider's callback ...
data = guidata(gcbo); % get the struct, use the handles:
set(data.valueEdit, 'String',...
num2str(get(data.valueSlider, 'Value')));
... excerpt from the edit's callback ...
data = guidata(gcbo); % need handles, may need error info
val = str2double(get(data.valueEdit,'String'));
if isnumeric(val) & length(val)==1 & ...
val >= get(data.valueSlider, 'Min') & ...
val <= get(data.valueSlider, 'Max')
set(data.valueSlider, 'Value', val);
else
% increment the error count, and display it
data.numberOfErrors = data.numberOfErrors + 1;
set(handles.valueEdit, 'String',...
[ data.errorString, num2str(data.numberOfErrors) ]);
guidata(gcbo, data); % store the changes...
end
Note that GUIDE generates callback functions to which a structure
of handles is passed automatically as an input argument. This
eliminates the need to call "data = guidata(gcbo);" in callbacks
written using GUIDE, unlike the example above.
以一个简单的一元二次方程求解为例
先看看自动 生成的M代码
function varargout = test1(varargin) % TEST1 M-file for test1.fig % TEST1, by itself, creates a new TEST1 or raises the existing % singleton*. % % H = TEST1 returns the handle to a new TEST1 or the handle to % the existing singleton*. % % TEST1('CALLBACK',hObject,eventData,handles,...) calls the local % function named CALLBACK in TEST1.M with the given input arguments. % % TEST1('Property','Value',...) creates a new TEST1 or raises the % existing singleton*. Starting from the left, property value pairs are % applied to the GUI before test1_OpeningFcn gets called. An % unrecognized property name or invalid value makes property application % stop. All inputs are passed to test1_OpeningFcn via varargin. % % *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one % instance to run (singleton)". % % See also: GUIDE, GUIDATA, GUIHANDLES % Edit the above text to modify the response to help test1 % Last Modified by GUIDE v2.5 04-Oct-2012 17:21:13 % Begin initialization code - DO NOT EDIT gui_Singleton = 1; gui_State = struct('gui_Name', mfilename, ... 'gui_Singleton', gui_Singleton, ... 'gui_OpeningFcn', @test1_OpeningFcn, ... 'gui_OutputFcn', @test1_OutputFcn, ... 'gui_LayoutFcn', [] , ... 'gui_Callback', []); if nargin && ischar(varargin{1}) gui_State.gui_Callback = str2func(varargin{1}); end if nargout [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:}); else gui_mainfcn(gui_State, varargin{:}); end % End initialization code - DO NOT EDIT % --- Executes just before test1 is made visible. function test1_OpeningFcn(hObject, eventdata, handles, varargin) % This function has no output args, see OutputFcn. % hObject handle to figure % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % varargin command line arguments to test1 (see VARARGIN) % Choose default command line output for test1 handles.output = hObject; % Update handles structure guidata(hObject, handles); % UIWAIT makes test1 wait for user response (see UIRESUME) % uiwait(handles.figure1); % --- Outputs from this function are returned to the command line. function varargout = test1_OutputFcn(hObject, eventdata, handles) % varargout cell array for returning output args (see VARARGOUT); % hObject handle to figure % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Get default command line output from handles structure varargout{1} = handles.output; % --- Executes on button press in btn_draw. function btn_draw_Callback(hObject, eventdata, handles) % hObject handle to btn_draw (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) function a_num_Callback(hObject, eventdata, handles) % hObject handle to a_num (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of a_num as text % str2double(get(hObject,'String')) returns contents of a_num as a double % --- Executes during object creation, after setting all properties. function a_num_CreateFcn(hObject, eventdata, handles) % hObject handle to a_num (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end function b_num_Callback(hObject, eventdata, handles) % hObject handle to b_num (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of b_num as text % str2double(get(hObject,'String')) returns contents of b_num as a double % --- Executes during object creation, after setting all properties. function b_num_CreateFcn(hObject, eventdata, handles) % hObject handle to b_num (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end function c_num_Callback(hObject, eventdata, handles) % hObject handle to c_num (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of c_num as text % str2double(get(hObject,'String')) returns contents of c_num as a double % --- Executes during object creation, after setting all properties. function c_num_CreateFcn(hObject, eventdata, handles) % hObject handle to c_num (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end
基本界面如下
发表评论
-
R语言与数据分析
2015-05-15 20:58 2075当今计算机系统要处理的数据类型变得多种多样,并且为了深入理 ... -
机器学习实践指南:案例应用解析
2014-04-17 19:53 1005试读及购买链接 《机器 ... -
matlab-矩阵合并
2013-06-10 13:56 3133a = 1 2 3 2 -
人工智能与数据分析所需要的知识
2013-04-30 18:27 292想较好得在数据分析和人工智能相关领域发展,最好具备以下基础: ... -
麦哈普的AI乐园【myhaspl@qq.com】我的另一个博客(机器学习、数据分析、智能计算的原创)
2013-04-28 10:52 11http://blog.csdn.net/u0102556 ... -
R-并行计算
2013-04-28 10:50 6069啊。。。找了一下,R 居然真的有办法可以多cpu平行运算!! ... -
谱聚类
2013-04-11 10:44 26691. 谱聚类 给你博客园上若干个博客,让你将它 ... -
对变化建模-用差分方程-动力系统及常数解
2013-04-09 15:24 1385差分表示在一个时间周期里考察对象的变化量。 差分表示在一个时 ... -
逻辑斯蒂映射-伪随机数
2013-04-04 15:28 3310逻辑斯蒂映射的形式为 x_(n+1)=ax_n( ... -
matlab-多项式乘除法及式子和导数
2013-03-21 15:06 4594>> a=[22 12 4 54] ... -
matlab-数组-元胞数据与结构数组
2013-03-20 17:45 3234y、z是元胞数组,num2cell完成由数值数组到元胞数组的 ... -
矩阵-范数
2013-03-13 17:30 1852>> a a = 12 33 ... -
向量-范数
2013-03-13 16:06 2279>> b=a(3,:) b = 22 ... -
矩阵-求逆
2013-02-27 15:51 2467设R是一个交换环,A是 ... -
lisp-猜数字算法与全局函数、变量
2013-01-30 17:55 1608* (defvar *big* 100) *BIG* ... -
开源 Lisp 相关项目
2013-01-19 22:38 3855IOLib 项目 (http://common-lisp.n ... -
四分位数求法
2012-11-22 20:18 2793四分位数间距:是上四分位数与下四分位数之差,用四分位数间距可反 ... -
matlab-神经网络-自定义多层感知器解决异或(2)
2012-10-10 22:33 2457继续定义单元神经元 net.inputs{i}.ran ... -
matlab-神经网络-自定义多层感知器解决异或(1)
2012-10-09 22:41 5145>> net=network net = ... -
matlab-模态对话框
2012-10-05 16:59 3486modal dialog box with the comm ...
相关推荐
此文件设计matlab-gui的一些东西。
第6章MATLAB-GUI程序设计.ppt
(精品)我的简易计算器MATLAB-gui程序.doc
【工控老马出品,必属精品,亲测校正,质量保证】 资源名:MATLAB-GUI开发案例源码.zip 资源类型:程序源代码 源码说明: MATLAB-GUI开发案例源码 适合人群:新手及有一定经验的开发人员
基于MATLAB-GUI的数字图像处理课程设计代码,可实现多种图像处理操作
初步学习设计MATLAB-GUI用户界面设计及实现,了解GUI用户界面上菜单的基本功能,理解设计GUI用户界面常用的程序代码。
数值分析程序matlab-GUI,界面相对简单,初学者可以看看了解。
STK-matlab GUI仿真程序
基于Matlab-GUI的数值积分界面设计.pdf
关于-matlab-gui设计界面按键激活及源程序(精品文档).ppt
1. 通过鼠标选点绘制 B 样条:设定 B 样条曲线的度数(默认值为 2,即 3 次 B 2. 任意拖动控制点,动态绘制控制多边形和 B 样条曲线,如 Figu
哈工大数学实验的作业 实现Matlab GUI的程序 是一个画图程序
matlabGUI MATLAB GUI(源程序)学习GUI的好资料。MATLAB GUI简单的文本框数据传递(源程序)
基于MATLAB-GUI的刚性桩复合地基沉降计算.pdf
2.内容:【提供程序操作视频】m基于MATLAB-GUI的GPS数据经纬度高度解析与kalman分析软件设计 3.用处:用于GPS数据经纬度高度解析与kalman分析算法编程学习 4.指向人群:本硕博等学习教研使用,企事业简单项目方案...
matlab GUI学习资料之MATLAB GUI3:滚动条数值显示在文本框中(源程序)
用户界面(或接口)是指:人...MATLAB 为表现其基本功能而设计的演示程序demo 是使用图形界面的最好范例。 MATLAB的用户,在指令窗中运行demo 打开那图形界面后,只要用鼠标进行选择和点击,就可浏览那丰富多彩的内容。
基于MATLAB-GUI的信号采集与分析系统设计.pdf
基于MATLAB-GUI的风电机组功率特性测试数据分析.pdf
matlab开发-一个简单的Matlabgui程序。一个简单的Matlab图形用户界面程序