📄 bode.asv
字号:
function varargout = bode(varargin)
% BODE M-file for bode.fig
% BODE, by itself, creates a new BODE or raises the existing
% singleton*.
%
% H = BODE returns the handle to a new BODE or the handle to
% the existing singleton*.
%
% BODE('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in BODE.M with the given input arguments.
%
% BODE('Property','Value',...) creates a new BODE or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before bode_OpeningFunction gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to bode_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 bode
% Last Modified by GUIDE v2.5 17-Apr-2006 18:04:30
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @bode_OpeningFcn, ...
'gui_OutputFcn', @bode_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 bode is made visible.
function bode_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 bode (see VARARGIN)
% Choose default command line output for bode
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes bode wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = bode_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;
h3=axes('Position',[0.14,0.4,0.7,0.5]);
set(h3,'Xlim',[0,1.0],'Ylim',[0,0.3])
set(h3,'DataAspectRatio',[1 1 1])
set(h3,'ColorOrder',[0 0 0])
set(h3,'Visible','off')
x1=0.30:0.01:0.75; y1=0.15*ones(size(x1));
line(x1,y1,'linewidth',1.5)
text(0.1,0.15,'\fontsize{20}\bfG(z)=');
text(0.37,0.19,'\fontsize{17}\bf0.74z+0.52');
text(0.34,0.11,'\fontsize{17}\bfz^2-1.37z+0.37');
% --- Executes on button press in pushbutton1.
function 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 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 && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
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)
figure(1);
num=[0.74 0.52]
den=[1 -1.37 0.37];
T=3
dbode(num,den,T)
grid
% --- Executes on button press in pushbutton2.
function pushbutton2_Callback(hObject, eventdata, handles)
figure(2)
num=[0.74 0.52]
den=[1 -1.37 0.37];
dnyquist(num,den,1)
grid
% 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 selection change in popupmenu1.
function popupmenu1_Callback(hObject, eventdata, handles)
% hObject handle to popupmenu1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: contents = get(hObject,'String') returns popupmenu1 contents as cell array
% contents{get(hObject,'Value')} returns selected item from popupmenu1
% --- Executes during object creation, after setting all properties.
function popupmenu1_CreateFcn(hObject, eventdata, handles)
% hObject handle to popupmenu1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: popupmenu 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
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -