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

📄 plant_model4pid.m

📁 很优良的PID控制器设计仿真程序与模型,经过严格检验
💻 M
字号:
function varargout = plant_model4pid(varargin)
% PLANT_MODEL4PID M-file for plant_model4pid.fig
%      PLANT_MODEL4PID, by itself, creates a new PLANT_MODEL4PID or raises the existing
%      singleton*.
%
%      H = PLANT_MODEL4PID returns the handle to a new PLANT_MODEL4PID or the handle to
%      the existing singleton*.
%
%      PLANT_MODEL4PID('CALLBACK',hObject,eventData,handles,...) calls the local
%      function named CALLBACK in PLANT_MODEL4PID.M with the given input arguments.
%
%      PLANT_MODEL4PID('Property','Value',...) creates a new PLANT_MODEL4PID or raises the
%      existing singleton*.  Starting from the left, property value pairs are
%      applied to the GUI before plant_model4pid_OpeningFunction gets called.  An
%      unrecognized property name or invalid value makes property application
%      stop.  All inputs are passed to plant_model4pid_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 plant_model4pid

% Last Modified by GUIDE v2.5 28-Jul-2003 20:47:21
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
                   'gui_Singleton',  gui_Singleton, ...
                   'gui_OpeningFcn', @plant_model4pid_OpeningFcn, ...
                   'gui_OutputFcn',  @plant_model4pid_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


function h_sub_btnApply_Callback(hObject, eventdata, handles)try
    num=str2num(get(handles.h_sub_edtNum,'String'));
    den=str2num(get(handles.h_sub_edtDen,'String'));
    tdly=str2num(get(handles.h_sub_edtDelay,'String'));
    G=tf(num,den,'iodelay',tdly);
    hButton=findobj('Tag','h_btnPlant');     
    set(hButton,'UserData',G);
    set(gcf,'Visible','off');                              
catch
    errordlg({'Error in model representation';lasterr},'Error in model')
end
function h_mod_btnCancel_Callback(hObject, eventdata, handles)
set(handles.h_wndPIDSub,'Visible','off');

%DO NOT modify the sentences belowfunction plant_model4pid_OpeningFcn(hObject, eventdata, handles, varargin)
handles.output = hObject;
guidata(hObject, handles);
function varargout = plant_model4pid_OutputFcn(hObject, eventdata, handles)
varargout{1} = handles.output;
function h_sub_edtNum_CreateFcn(hObject, eventdata, handles)
if ispc
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end
function h_sub_edtDen_Callback(hObject, eventdata, handles)
function h_sub_edtDelay_CreateFcn(hObject, eventdata, handles)
if ispc
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end
function h_sub_edtDelay_Callback(hObject, eventdata, handles)
function h_sub_edtNum_Callback(hObject, eventdata, handles)
function h_sub_edtDen_CreateFcn(hObject, eventdata, handles)
if ispc
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end
% --- Executes on button press in h_mod_btnHelp.function h_mod_btnHelp_Callback(hObject, eventdata, handles)% hObject    handle to h_mod_btnHelp (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)

⌨️ 快捷键说明

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