⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 diyi.asv

📁 都是一些matlab图形用户界面的设计实例
💻 ASV
📖 第 1 页 / 共 2 页
字号:
function varargout = diyi(varargin)
% DIYI M-file for diyi.fig
%      DIYI, by itself, creates a new DIYI or raises the existing
%      singleton*.
%
%      H = DIYI returns the handle to a new DIYI or the handle to
%      the existing singleton*.
%
%      DIYI('CALLBACK',hObject,eventData,handles,...) calls the local
%      function named CALLBACK in DIYI.M with the given input arguments.
%
%      DIYI('Property','Value',...) creates a new DIYI or raises the
%      existing singleton*.  Starting from the left, property value pairs are
%      applied to the GUI before diyi_OpeningFunction gets called.  An
%      unrecognized property name or invalid value makes property application
%      stop.  All inputs are passed to diyi_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 diyi

% Last Modified by GUIDE v2.5 14-May-2005 14:07:48
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
                   'gui_Singleton',  gui_Singleton, ...
                   'gui_OpeningFcn', @diyi_OpeningFcn, ...
                   'gui_OutputFcn',  @diyi_OutputFcn, ...
                   'gui_LayoutFcn',  [] , ...
                   'gui_Callback',   []);
if nargin & isstr(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 diyi is made visible.
function diyi_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 diyi (see VARARGIN)

% Choose default command line output for diyi
handles.output = hObject;

% Update handles structure
guidata(hObject, handles);

% UIWAIT makes diyi wait for user response (see UIRESUME)
% uiwait(handles.figure1);


% --- Outputs from this function are returned to the command line.
function varargout = diyi_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 Untitled_1_Callback(hObject, eventdata, handles)% hObject    handle to Untitled_1 (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)% --------------------------------------------------------------------function Untitled_4_Callback(hObject, eventdata, handles)% hObject    handle to Untitled_4 (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)figure(q)
% --------------------------------------------------------------------function Untitled_5_Callback(hObject, eventdata, handles)% hObject    handle to Untitled_5 (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)global A,
global B,
global C,
global D,
global num1,
global den1,
filename=inputdlg('Please input filename')
save filename num1 den1% --------------------------------------------------------------------function Untitled_6_Callback(hObject, eventdata, handles)% hObject    handle to Untitled_6 (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)global A,
global B,
global C,
global D,
global num1,
global den1,
load filename % --------------------------------------------------------------------function Untitled_2_Callback(hObject, eventdata, handles)% hObject    handle to Untitled_2 (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)% --------------------------------------------------------------------function Untitled_7_Callback(hObject, eventdata, handles)% hObject    handle to Untitled_7 (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)% --------------------------------------------------------------------function Untitled_8_Callback(hObject, eventdata, handles)% hObject    handle to Untitled_8 (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)% --------------------------------------------------------------------function Untitled_9_Callback(hObject, eventdata, handles)% hObject    handle to Untitled_9 (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)% --------------------------------------------------------------------function Untitled_13_Callback(hObject, eventdata, handles)% hObject    handle to Untitled_13 (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)
% --------------------------------------------------------------------function Untitled_14_Callback(hObject, eventdata, handles)% hObject    handle to Untitled_14 (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)% --------------------------------------------------------------------function Untitled_15_Callback(hObject, eventdata, handles)% hObject    handle to Untitled_15 (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)global A,
global B,
global C,
global D,
%str=get(handles.edit10,'string');
%a=eval(str);
x=eig(A);
set(handles.text9,'string',x);
m=length(x)
for n=1:m
    if(real(x(n))>=0)
        set(handles.text8,'string','不稳定')
    else
        set(handles.text8,'string','稳定')
    end
end% --------------------------------------------------------------------function Untitled_3_Callback(hObject, eventdata, handles)% hObject    handle to Untitled_3 (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)% --------------------------------------------------------------------function Untitled_10_Callback(hObject, eventdata, handles)% hObject    handle to Untitled_10 (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)global A,
global B,
global C,
global D,
%str=get(handles.edit10,'string');
%a=eval(str);
%str=get(handles.edit11,'string');
%b=eval(str);
str=get(handles.edit6,'string');
p=eval(str);
k=place(A,B,p);
set(handles.text12,'string',k)% --------------------------------------------------------------------function Untitled_11_Callback(hObject, eventdata, handles)% hObject    handle to Untitled_11 (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)global A,
global B,
global C,
global D,
%str=get(handles.edit10,'string');
%a=eval(str);
%str=get(handles.edit3,'string');
%c=eval(str);
str=get(handles.edit7,'string');
p=eval(str);
l=acker(A',C',p).';
set(handles.text13,'string',l);
% --------------------------------------------------------------------function Untitled_12_Callback(hObject, eventdata, handles)% hObject    handle to Untitled_12 (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)% --------------------------------------------------------------------function Untitled_16_Callback(hObject, eventdata, handles)% hObject    handle to Untitled_16 (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)global A,
global B,
global C,
global D,
%str=get(handles.edit10,'string');
%a=eval(str);
%str=get(handles.edit11,'string');
%b=eval(str);
co=ctrb(A,B);
m=rank(co);
n=length(A);
if(m==n)
    set(handles.text6,'string','可控');
else
    set(handles.text6,'string','不可控');
end   

% --------------------------------------------------------------------function Untitled_17_Callback(hObject, eventdata, handles)% hObject    handle to Untitled_17 (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)global A,
global B,
global C,
global D,
%str=get(handles.edit10,'string');
%a=eval(str);
%str=get(handles.edit3,'string');
%c=eval(str);
co=obsv(A,C);
m=rank(co);
n=length(A);
if(m==n)
    set(handles.text7,'string','可观');
else
    set(handles.text7,'string','不可观');
end   % --- Executes during object creation, after setting all properties.function edit1_CreateFcn(hObject, eventdata, handles)% hObject    handle to edit1 (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    set(hObject,'BackgroundColor','white');else    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));endfunction edit1_Callback(hObject, eventdata, handles)% hObject    handle to edit1 (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 edit1 as text%        str2double(get(hObject,'String')) returns contents of edit1 as a double% --- Executes during object creation, after setting all properties.function edit2_CreateFcn(hObject, eventdata, handles)% hObject    handle to edit2 (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    set(hObject,'BackgroundColor','white');else    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));endfunction edit2_Callback(hObject, eventdata, handles)% hObject    handle to edit2 (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 edit2 as text%        str2double(get(hObject,'String')) returns contents of edit2 as a double% --- Executes during object creation, after setting all properties.function edit3_CreateFcn(hObject, eventdata, handles)% hObject    handle to edit3 (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    set(hObject,'BackgroundColor','white');else    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));endfunction edit3_Callback(hObject, eventdata, handles)% hObject    handle to edit3 (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 edit3 as text%        str2double(get(hObject,'String')) returns contents of edit3 as a double% --- Executes during object creation, after setting all properties.function edit4_CreateFcn(hObject, eventdata, handles)% hObject    handle to edit4 (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -