No BSD License  

Highlights from
CaToKi V2. System Identification ToolKit in Open loop SISO.

image thumbnail

CaToKi V2. System Identification ToolKit in Open loop SISO.

by

 

04 Apr 2007 (Updated )

Is an easy tool for system idenfication of real procces.

integ(varargin)
function varargout = integ(varargin)
% INTEG M-file for integ.fig
%      INTEG, by itself, creates a new INTEG or raises the existing
%      singleton*.
%
%      H = INTEG returns the handle to a new INTEG or the handle to
%      the existing singleton*.
%
%      INTEG('CALLBACK',hObject,eventData,handles,...) calls the local
%      function named CALLBACK in INTEG.M with the given input arguments.
%
%      INTEG('Property','Value',...) creates a new INTEG or raises the
%      existing singleton*.  Starting from the left, property value pairs are
%      applied to the GUI before integ_OpeningFunction gets called.  An
%      unrecognized property name or invalid value makes property application
%      stop.  All inputs are passed to integ_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 integ

% Last Modified by GUIDE v2.5 30-Apr-2006 19:38:31

% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
                   'gui_Singleton',  gui_Singleton, ...
                   'gui_OpeningFcn', @integ_OpeningFcn, ...
                   'gui_OutputFcn',  @integ_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 integ is made visible.
function integ_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 integ (see VARARGIN)

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

% Update handles structure
guidata(hObject, handles);

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


% --- Outputs from this function are returned to the command line.
function varargout = integ_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 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)
if ispc
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end

set(hObject, 'String', {'1','2','3'});%,'12.-Respuesta a la entrada dada'});


% --- Executes on selection change in popupmenu2.
function popupmenu2_Callback(hObject, eventdata, handles)
% hObject    handle to popupmenu2 (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 popupmenu2 contents as cell array
%        contents{get(hObject,'Value')} returns selected item from popupmenu2


% --- Executes during object creation, after setting all properties.
function popupmenu2_CreateFcn(hObject, eventdata, handles)
if ispc
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end

set(hObject, 'String', {'1','2','3'});%,'12.-Respuesta a la entrada dada'});


% --- Executes on button press in pushbutton1.
function pushbutton1_Callback(hObject, eventdata, handles)

popup_sel_index1 = get(handles.popupmenu1, 'Value');
salida = evalin('base', 'salida');
h=0.1
 z=tf('z',h);
derivada=(1-z^-1);                                          %----------> si integro=1/(1-z^-1)
t=0:h:(h*length(salida)-1*h);
t=t';
assignin('base','t',t);
der1ra=lsim(derivada,salida,t,'zoh');
der2da=lsim(derivada,der1ra,t,'zoh');
der3ra=lsim(derivada,der2da,t,'zoh');
switch popup_sel_index1
    case 1
   

assignin('base','salida',der1ra);
    case 2
assignin('base','salida',der2da);
    case 3
        assignin('base','salida',der3ra);
end

        


% --- Executes on button press in pushbutton2.
function pushbutton2_Callback(hObject, eventdata, handles)
popup_sel_index1 = get(handles.popupmenu1, 'Value');
salida = evalin('base', 'salida');
h=0.1
 z=tf('z',h);
derivada=(1-z^-1);  
integral=inv(derivada)
%----------> si integro=1/(1-z^-1)
t=0:h:(h*length(salida)-1*h);
t=t';
assignin('base','t',t);
int1ra=lsim(integral,salida,t,'zoh');
int2da=lsim(integral,int1ra,t,'zoh');
int3ra=lsim(integral,int2da,t,'zoh');
switch popup_sel_index1
    case 1
   

assignin('base','salida',int1ra);
    case 2
assignin('base','salida',int2da);
    case 3
        assignin('base','salida',int3ra);
end

        function pushbutton3_Callback(hObject, eventdata, handles)
close integ





% --- Executes on button press in pushbutton4.
function pushbutton4_Callback(hObject, eventdata, handles)
open integra.mdl


Contact us