No BSD License  

Highlights from
Double Exponentian Calculating Program

from Double Exponentian Calculating Program by Andrés Vanegas
This program compute the double exponential Alpha and Beta parameters.

FRYO(varargin)
function varargout = FRYO(varargin)

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

% Copyright 2002-2003 The MathWorks, Inc.

% Edit the above text to modify the response to help FRYO

% Last Modified by GUIDE v2.5 10-Apr-2005 19:22:38

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

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

% Update handles structure
guidata(hObject, handles);

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


% --- Outputs from this function are returned to the command line.
function varargout = FRYO_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;

axes(handles.axes1);
image(imread('wave','bmp'));
set(handles.axes1,'Xtick',[]);
set(handles.axes1,'Ytick',[]);

function edit1_Callback(hObject, eventdata, handles)

Imax=str2double(get(hObject,'String'));

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 && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end

function edit2_Callback(hObject, eventdata, handles)

t1= str2double(get(hObject,'String'));

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 edit3_Callback(hObject, eventdata, handles)

t2= str2double(get(hObject,'String'));

% --- 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 && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end

function edit4_Callback(hObject, eventdata, handles)

function edit4_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit4 (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 edit6_Callback(hObject, eventdata, handles)

function edit6_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit6 (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 edit5_Callback(hObject, eventdata, handles)

function edit5_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit5 (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)

global t1 t2 valores
Imax = str2double(get(handles.edit1,'string'));
t1 = str2double(get(handles.edit2,'string'));
t2 = str2double(get(handles.edit3,'string'));
if  isnan(Imax) | isnan(t1) | isnan(t2) | t1<=0 | t2<=0 | t1>=t2
    warndlg('Check input data')
else
    valores=NUEVO(Imax);
    set(handles.axes1,'visible','on');
    set(handles.uipanel2,'visible','on');    
    set(handles.edit4,'string',num2str(valores(1)));
    set(handles.edit5,'string',num2str(valores(2)));
    set(handles.edit6,'string',num2str(valores(3)));
    set(handles.pushbutton2,'visible','on');   
    set(handles.pushbutton4,'visible','on');   
end



function pushbutton2_Callback(hObject, eventdata, handles)
global t1 t2 valores
Imax = str2double(get(handles.edit1,'string'));
tus=0:t2/1000:1.4*t2;
f=Imax*valores(1)*(exp(-valores(2)*tus)-exp(-valores(3)*tus));
figure
plot(tus,f)
grid
hold on
% GRAFICA RECTA AUXILIAR (CONSTRUCCION GEOMETRICA)
if t1~=8 & t2~=20
ti=[valores(4) valores(5)];
yi=[0.3*Imax 0.9*Imax];
tt=-0.3*t1:0.001:t1;
yy=interp1(ti,yi,tt,'linear','extrap');
plot(ti,yi,'o',tt,yy)
Title('IMPULSE WAVE FORM');
xlabel('Time [us]');
ylabel('Amplitude [kA]');
end


% --- Executes on button press in pushbutton4.
function pushbutton4_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton4 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
set(handles.pushbutton2,'visible','off');   
set(handles.pushbutton4,'visible','off');   
set(handles.uipanel2,'visible','off');
set(handles.edit1,'string',' ');
set(handles.edit2,'string',' ');
set(handles.edit3,'string',' ');

Contact us at files@mathworks.com