Matlab GUI设计
来源:互联网 发布:ucloud云计算 校园 编辑:程序博客网 时间:2024/04/28 10:34
Matlab设计图形用户界面
设计的比较简易,通过修改对象属性代码等可以更精细。
function varargout = Guide2(varargin)% Simple example of Matlab GUI, by wanglei% Last Modified by GUIDE v2.5 10-Nov-2016 17:04:09% Begin initialization code - DO NOT EDITgui_Singleton = 1;gui_State = struct('gui_Name', mfilename, ... 'gui_Singleton', gui_Singleton, ... 'gui_OpeningFcn', @Guide2_OpeningFcn, ... 'gui_OutputFcn', @Guide2_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 Guide2 is made visible.function Guide2_OpeningFcn(hObject, eventdata, handles, varargin)% Choose default command line output for Guide2handles.output = hObject;% Update handles structureguidata(hObject, handles);% UIWAIT makes Guide2 wait for user response (see UIRESUME)% uiwait(handles.figure1);% --- Outputs from this function are returned to the command line.function varargout = Guide2_OutputFcn(hObject, eventdata, handles) varargout{1} = handles.output;% --------------------------------------------------------------------function file_1_Callback(hObject, eventdata, handles)% --------------------------------------------------------------------function Untitled_5_Callback(hObject, eventdata, handles)% --------------------------------------------------------------------function Untitled_1_Callback(hObject, eventdata, handles)% --------------------------------------------------------------------function Untitled_3_Callback(hObject, eventdata, handles)% --------------------------------------------------------------------function Untitled_4_Callback(hObject, eventdata, handles)% --------------------------------------------------------------------function Untitled_6_Callback(hObject, eventdata, handles)% --------------------------------------------------------------------function Untitled_7_Callback(hObject, eventdata, handles)% --------------------------------------------------------------------function Untitled_8_Callback(hObject, eventdata, handles)% --------------------------------------------------------------------function Untitled_9_Callback(hObject, eventdata, handles)% --- Executes on selection change in listbox1.function listbox1_Callback(hObject, eventdata, handles)% Hints: contents = cellstr(get(hObject,'String')) returns listbox1 contents as cell array% contents{get(hObject,'Value')} returns selected item from listbox1% --- Executes during object creation, after setting all properties.function listbox1_CreateFcn(hObject, eventdata, handles)if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');end% --- Executes on button press in pushbutton1.function pushbutton1_Callback(hObject, eventdata, handles)am_1=get(handles.radiobutton1,'value');am_2=get(handles.radiobutton2,'value');if am_1==1 am=5;else am=10;endfre1=get(handles.listbox1,'string')whos fre1n=get(handles.listbox1,'value');fre=eval(fre1(n,:));x=0:0.1:10;axes(handles.axes1);plot(am*sin(fre*x));% --- Executes on button press in pushbutton2.function pushbutton2_Callback(hObject, eventdata, handles)close% --------------------------------------------------------------------function Untitled_10_Callback(hObject, eventdata, handles)% --------------------------------------------------------------------function Untitled_11_Callback(hObject, eventdata, handles)% --------------------------------------------------------------------function Untitled_12_Callback(hObject, eventdata, handles)% --------------------------------------------------------------------function Untitled_13_Callback(hObject, eventdata, handles)% --------------------------------------------------------------------function Untitled_14_Callback(hObject, eventdata, handles)% --------------------------------------------------------------------function Untitled_15_Callback(hObject, eventdata, handles)% --- Executes on button press in pushbutton3.function im1 = pushbutton3_Callback(hObject, eventdata, handles)[fname,pname] = uigetfile('*.*');im1 = imread([pname,fname]);axes(handles.axes2);imshow(im1);% --- Executes during object creation, after setting all properties.function axes1_CreateFcn(hObject, eventdata, handles)% --- Executes on button press in listbox2.function listbox2_Callback(hObject, eventdata, handles)% --- Executes on button press in pushbutton5.function pushbutton5_Callback(hObject, eventdata, handles)close% --- Executes on button press in pushbutton6.function pushbutton6_Callback(hObject, eventdata, handles)filt1 = get(handles.listbox2,'string');%whos filter1%celldisp(filter1)n = get(handles.listbox2,'value');filter1 = char(filt1{n});im1 = getimage(handles.axes2);%H=fspecial('gaussian',n,sigma);H = fspecial(filter1);im2 = imfilter(im1,H);imshow(im2);
0 0
- 请教matlab gui 设计
- Matlab GUI设计相关
- Matlab GUI设计笔记
- Matlab GUI 对话框设计
- MATLAB GUI对话框设计
- matlab GUI 设计
- MATLAB GUI对话框设计
- Matlab GUI设计
- [MATLAB]MATLAB GUI对话框设计
- [MATLAB]MATLAB GUI对话框设计
- MATLAB GUI设计学习—GUI数据管理
- MATLAB中的gui设计举例
- MATLAB中GUI设计领悟
- MATLAB中GUI设计领悟
- MATLAB GUI设计手写输入板
- 用Matlab GUI设计四则运算
- MATLAB图形用户界面设计GUI
- MATLAB GUI设计——绘图
- TabLayout+ViewPager遇到的问题
- ANR原因以及分析&&APP三大崩溃
- 笔试题:SQL统计各科目中各分数线人数
- 拾光碎片-----保存失败!未将对象引用设置到对象的实例
- Session详解
- Matlab GUI设计
- spark 的RDD依赖系
- [noip2007tg] 统计数字
- 数组字符串,企业笔试题
- Canvas截图
- Android ViewPager+RadioGroup+Fragment超高仿微信主界面
- JS获取URL中参数值(QueryString)的4种方法
- jQuery中学习遇到的问题
- lightoj 1108 - Instant View of Big Bang(SPFA负环)