matlab GUI callback 函数实现
来源:互联网 发布:sql自定义函数编写 编辑:程序博客网 时间:2024/05/16 23:37
搞了一下午,看了些资料,终于弄好了matlab GUI中的回调函数。
效果图见底部~
umtitled3.m:
function varargout = untitled3(varargin)% UNTITLED3 M-file for untitled3.fig% UNTITLED3, by itself, creates a new UNTITLED3 or raises the existing% singleton*.%% H = UNTITLED3 returns the handle to a new UNTITLED3 or the handle to% the existing singleton*.%% UNTITLED3('CALLBACK',hObject,eventData,handles,...) calls the local% function named CALLBACK in UNTITLED3.M with the given input arguments.%% UNTITLED3('Property','Value',...) creates a new UNTITLED3 or raises the% existing singleton*. Starting from the left, property value pairs are% applied to the GUI before untitled3_OpeningFunction gets called. An% unrecognized property name or invalid value makes property application% stop. All inputs are passed to untitled3_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% Copyright 2002-2003 The MathWorks, Inc.% Edit the above text to modify the response to help untitled3% Last Modified by GUIDE v2.5 18-Mar-2012 16:58:53% Begin initialization code - DO NOT EDITgui_Singleton = 1;gui_State = struct('gui_Name', mfilename, ... 'gui_Singleton', gui_Singleton, ... 'gui_OpeningFcn', @untitled3_OpeningFcn, ... 'gui_OutputFcn', @untitled3_OutputFcn, ... 'gui_LayoutFcn', [] , ... 'gui_Callback', []);if nargin && ischar(varargin{1}) gui_State.gui_Callback = str2func(varargin{1});endif 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 untitled3 is made visible.function untitled3_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 untitled3 (see VARARGIN)% Choose default command line output for untitled3handles.output = hObject;% Update handles structureguidata(hObject, handles);% UIWAIT makes untitled3 wait for user response (see UIRESUME)% uiwait(handles.figure1);% --- Outputs from this function are returned to the command line.function varargout = untitled3_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 structurevarargout{1} = handles.output;% --- Executes on button press in openfile.function openfile_Callback(hObject, eventdata, handles)%打开文件global filepfilep=OnFileOpen();% hObject handle to openfile (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% --- Executes on button press in pushbutton2.function pushbutton2_Callback(hObject, eventdata, handles)%求取sift特征global filepglobal im1global des1global loc1[im1,des1,loc1] = sift(filep);showkeys(im1,loc1);% hObject handle to pushbutton2 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% --- Executes on button press in pushbutton3.function pushbutton3_Callback(hObject, eventdata, handles)%写入txt文件global im1global des1global loc1fid=fopen('matrix.txt','w');fprintf(fid,'%f',des1);%sift特征fclose(fid);% hObject handle to pushbutton3 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)
图片贴上:
design view:
result view:
property inspector:
- matlab GUI callback 函数实现
- matlab--gui--callback
- MATLAB GUI中Edit Text的Callback函数何时执行
- 【matlab】GUI CreateFcn+Callback+keypressfcn用法
- MATLAB GUI ,2,使用MATLAB的函数来实现MATLAB GUI,part 4,小游戏
- matlab GUI中打开文件并做button的Callback
- MATLAB GUI ,2,使用MATLAB的函数来实现MATLAB GUI,part 1,图像、按钮和坐标轴
- MATLAB GUI ,2,使用MATLAB的函数来实现MATLAB GUI,part 2,eval和回调函数
- MATLAB GUI ,2,使用MATLAB的函数来实现MATLAB GUI,part 3,全局变量,计时器和状态机
- matlab gui 以及常用函数
- MATLAB GUI常用函数使用
- matlab gui 以及常用函数
- matlab callback
- matlab GUI 实现文件夹选择
- MATLAB GUI ,2,使用MATLAB的函数来实现MATLAB GUI,part 5,imshow绘图方式以及主辅图像缓存
- Matlab的GUI中在Callback的字符串形式的编写格式
- edit box callback 函数控制 字符输入 matlab
- Matlab GUI通用函数get和set
- 高性能Web服务器Nginx的配置与部署研究(15)Upstream负载均衡模块
- KeilC51中的库函数printf
- MongoDb实践总结(一)
- 深搜
- Oracle 常用命令
- matlab GUI callback 函数实现
- NYOJ-467 中缀式变后缀式【逆波兰法】
- C语言的变量声明在其它语句之前
- 对用户的密码进行加密
- hdoj 1142 A Walk Through the Forest
- clock,clock_t,times的注意事项
- HDU 1241Oil Deposits
- window.open()详细解释
- FVWM简明使用指南——王垠