矩阵平移旋转操作_gui_matlab function varargout = gui_matrix(varargin) % GUI_MATRIX M-file for gui_matrix.fig % GUI_MATRIX, by itself, creates a new GUI_MATRIX or raises the existing % singleton*. % % H = GUI_MATRIX returns the handle to a new GUI_MATRIX or the handle to % the existing singleton*. % % GUI_MATRIX(‘CALLBACK’,hObject,eventData,handles,…) calls the local % function named CALLBACK in GUI_MATRIX.M with the given input arguments. % % GUI_MATRIX(‘Property’,’Value’,…) creates a new GUI_MATRIX or raises the % existing singleton*. Starting from the left, property value pairs are % applied to the GUI before gui_matrix_OpeningFcn gets called. An % unrecognized property name or invalid value makes property application % stop. All inputs are passed to gui_matrix_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 gui_matrix % Last Modified by GUIDE v2.5 13-Jan-2010 08:03:51 % Begin initialization code – DO NOT EDIT gui_Singleton = 1; gui_State = struct(‘gui_Name’, mfilename, … ’gui_Singleton’, gui_Singleton, … ’gui_OpeningFcn’, @gui_matrix_OpeningFcn, … ’gui_OutputFcn’, @gui_matrix_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 gui_matrix is made visible. function gui_matrix_OpeningFcn(hObject, eventdata, handles, varargin) set(handles.matrix_edit,’String’,’1 2 3;4 5 6;7 8 9′); set(handles.K_edit,’String’,’-1′); set(handles.dim_edit,’String’,’2′); set(handles.k_edit,’String’,’2′); % 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 gui_matrix (see VARARGIN) % Choose default command line output for gui_matrix handles.output = hObject; % Update handles structure guidata(hObject, handles); % UIWAIT makes gui_matrix wait for user response (see UIRESUME) % uiwait(handles.figure1); % — Outputs from this function are returned to the command line. function varargout = gui_matrix_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; function matrix_edit_Callback(hObject, eventdata, handles) % hObject handle to matrix_edit (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 matrix_edit as text % str2double(get(hObject,’String’)) returns contents of matrix_edit as a double % — Executes during object creation, after setting all properties. function matrix_edit_CreateFcn(hObject, eventdata, handles) % hObject handle to matrix_edit (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 % — Executes on button press in diagk_pushbutton. function diagk_pushbutton_Callback(hObject, eventdata, handles) A=str2num(get(handles.matrix_edit,’String’)); k=str2num(get(handles.k_edit,’String’)); B1=diag(A,k) set(handles.matrix_text,’String’,num2str(B1)); % hObject handle to diagk_pushbutton (see GCBO) % eventdata reserved – to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) function k_edit_Callback(hObject, eventdata, handles) % hObject handle to k_edit (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 k_edit as text % str2double(get(hObject,’String’)) returns contents of k_edit as a double % — Executes during object creation, after setting all properties. function k_edit_CreateFcn(hObject, eventdata, handles) % hObject handle to k_edit (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 % — Executes on button press in diag_pushbutton. function diag_pushbutton_Callback(hObject, eventdata, handles) A=str2num(get(handles.matrix_edit,’String’)); B7=diag(A); set(handles.matrix_text,’String’,num2str(B7)); % hObject handle to diag_pushbutton (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 rot90_pushbutton. function rot90_pushbutton_Callback(hObject, eventdata, handles) A=str2num(get(handles.matrix_edit,’String’)) B3=rot90(A); set(handles.matrix_text,’String’,num2str(B3)); % hObject handle to rot90_pushbutton (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 rot90K_pushbutton. function rot90K_pushbutton_Callback(hObject, eventdata, handles) A=str2num(get(handles.matrix_edit,’String’)); K=str2num(get(handles.K_edit,’String’)); B2=rot90(A,K); set(handles.matrix_text,’String’,num2str(B2)); % hObject handle to rot90K_pushbutton (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 fliplr_pushbutton. function fliplr_pushbutton_Callback(hObject, eventdata, handles) A=str2num(get(handles.matrix_edit,’String’)) B4=fliplr(A); set(handles.matrix_text,’String’,num2str(B4)); % hObject handle to fliplr_pushbutton (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 flipud_pushbutton. function flipud_pushbutton_Callback(hObject, eventdata, handles) A=str2num(get(handles.matrix_edit,’String’)) B5=flipud(A); set(handles.matrix_text,’String’,num2str(B5)); % hObject handle to flipud_pushbutton (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 flipdim_pushbutton. function flipdim_pushbutton_Callback(hObject, eventdata, handles) A=str2num(get(handles.matrix_edit,’String’)); dim=str2num(get(handles.dim_edit,’String’)); B6=flipdim(A,dim); set(handles.matrix_text,’String’,num2str(B6)); % hObject handle to flipdim_pushbutton (see GCBO) % eventdata reserved – to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) function K_edit_Callback(hObject, eventdata, handles) % hObject handle to k_edit (see GCBO) % eventdata reserv
2024最新激活全家桶教程,稳定运行到2099年,请移步至置顶文章:https://sigusoft.com/99576.html
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。 文章由激活谷谷主-小谷整理,转载请注明出处:https://sigusoft.com/71591.html