
⛄一、获取代码方式
⛄二、部分源代码
function varargout = gui1(varargin)
%GUI1 M-file for gui1.fig
% GUI1, by itself, creates a new GUI1 or raises the existing
% singleton*.
%
% H = GUI1 returns the handle to a new GUI1 or the handle to
% the existing singleton*.
%
% GUI1(‘Property’,‘Value’,…) creates a new GUI1 using the
% given property value pairs. Unrecognized properties are passed via
% varargin to gui1_OpeningFcn. This calling syntax produces a
% warning when there is an existing singleton*.
%
% GUI1(‘CALLBACK’) and GUI1(‘CALLBACK’,hObject,…) call the
% local function named CALLBACK in GUI1.M with the given input
% arguments.
%
% *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 gui1
% Last Modified by GUIDE v2.5 13-Aug-2015 16:20:36
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct(‘gui_Name’, mfilename, …
‘gui_Singleton’, gui_Singleton, …
‘gui_OpeningFcn’, @gui1_OpeningFcn, …
‘gui_OutputFcn’, @gui1_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 gui1 is made visible.
function gui1_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 unrecognized PropertyName/PropertyValue pairs from the
% command line (see VARARGIN)
% Choose default command line output for gui1
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes gui1 wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% — Outputs from this function are returned to the command line.
function varargout = gui1_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 pushbutton1.
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
close(gcf)
run(‘gui2’)
% — Executes on button press in pushbutton3.
function pushbutton3_Callback(hObject, eventdata, handles)
% 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)
clear
clc
close all
% — Executes during object creation, after setting all properties.
function figure1_CreateFcn(hObject, eventdata, handles)
% hObject handle to figure1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
ha=axes(‘units’,‘normalized’,‘position’,[0 0 1 1]);
uistack(ha,‘down’)
II=imread(‘03.jpg’);
image(II)
colormap gray
set(ha,‘handlevisibility’,‘off’,‘visible’,‘off’);
⛄三、运行结果





⛄四、matlab版本及参考文献
1 matlab版本
2014a
2 参考文献
[1]李昕.MATLAB数学建模[M].清华大学出版社.2017
[2]王健,赵国生.MATLAB数学建模与仿真[M].清华大学出版社.2016
[3]余胜威.MATLAB数学建模经典案例实战[M].清华大学出版社.2015
3 备注
简介此部分摘自互联网,仅供参考,若侵权,联系删除
该文展示了一段MATLABGUI的源代码,包括创建GUI界面、设置回调函数以及控件交互的实现。代码中定义了OpeningFcn和OutputFcn等关键函数,还涉及到图象处理和窗口控制。用户可以通过按钮触发不同的功能,如调用其他GUI或关闭当前窗口。
317

被折叠的 条评论
为什么被折叠?



