You are on page 1of 5

function varargout = EXAMENFI(varargin)

% EXAMENFI MATLAB code for EXAMENFI.fig


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

% Last Modified by GUIDE v2.5 19-Jul-2017 15:59:04

% Begin initialization code - DO NOT EDIT


gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @EXAMENFI_OpeningFcn, ...
'gui_OutputFcn', @EXAMENFI_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 EXAMENFI is made visible.


function EXAMENFI_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 EXAMENFI (see VARARGIN)

% Choose default command line output for EXAMENFI


handles.output = hObject;
% Update handles structure
guidata(hObject, handles);

% UIWAIT makes EXAMENFI wait for user response (see UIRESUME)


% uiwait(handles.figure1);

% --- Outputs from this function are returned to the command line.
function varargout = EXAMENFI_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 Inic_Callback(hObject, eventdata, handles)


% hObject handle to Inic (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 Inic as text


% str2double(get(hObject,'String')) returns contents of Inic as a double

% --- Executes during object creation, after setting all properties.


function Inic_CreateFcn(hObject, eventdata, handles)
% hObject handle to Inic (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 Npun_Callback(hObject, eventdata, handles)


% hObject handle to Npun (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 Npun as text


% str2double(get(hObject,'String')) returns contents of Npun as a double

% --- Executes during object creation, after setting all properties.


function Npun_CreateFcn(hObject, eventdata, handles)
% hObject handle to Npun (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 TINIC_Callback(hObject, eventdata, handles)


% hObject handle to TINIC (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 TINIC as text


% str2double(get(hObject,'String')) returns contents of TINIC as a double

% --- Executes during object creation, after setting all properties.


function TINIC_CreateFcn(hObject, eventdata, handles)
% hObject handle to TINIC (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 TFINIC_Callback(hObject, eventdata, handles)


% hObject handle to TFINIC (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 TFINIC as text


% str2double(get(hObject,'String')) returns contents of TFINIC as a double

% --- Executes during object creation, after setting all properties.


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

% --- Executes on selection change in LISTRES.


function LISTRES_Callback(hObject, eventdata, handles)
% hObject handle to LISTRES (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

% Hints: contents = cellstr(get(hObject,'String')) returns LISTRES contents as cell array


% contents{get(hObject,'Value')} returns selected item from LISTRES

% --- Executes during object creation, after setting all properties.


function LISTRES_CreateFcn(hObject, eventdata, handles)
% hObject handle to LISTRES (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called

% Hint: listbox 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

% --- Executes on selection change in LISTT.


function LISTT_Callback(hObject, eventdata, handles)
% hObject handle to LISTT (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

% Hints: contents = cellstr(get(hObject,'String')) returns LISTT contents as cell array


% contents{get(hObject,'Value')} returns selected item from LISTT

% --- Executes during object creation, after setting all properties.


function LISTT_CreateFcn(hObject, eventdata, handles)
% hObject handle to LISTT (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called

% Hint: listbox 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

% --- Executes on button press in pushbutton1.


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)
Inic=str2num(get(handles.Inic,'string'));
TINIC=str2num(get(handles.TINIC,'string'));
TFINIC=str2num(get(handles.TFINIC,'string'));
A=str2num(get(handles.A,'string'));
EMAY=str2num(get(handles.EMAY,'string'));
t=TINIC:Inic:TFINIC
AW=((EMAY+((EMAY)^(2)-1)^(0.5))/(2*(((EMAY)^(2)-1)^(0.5))));
AW1=exp(-A*(EMAY-((EMAY^2)-1)^(0.5))*t);
AW2=((EMAY-((EMAY)^(2)-1)^(0.5))/(2*(((EMAY^2)-1)^(0.5))));
AW3=exp(-A*(EMAY+((EMAY^2)-1)^(0.5)));
SEJ=10*(1-(AW*AW1)+(AW2*AW3));
plot(t,SEJ);
np=(TFINIC-TINIC)/Inic;
set(handles.LISTT,'string',t);
set(handles.LISTRES,'string',SEJ);
set(handles.Npun,'string',np);

function EMAY_Callback(hObject, eventdata, handles)


% hObject handle to EMAY (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 EMAY as text


% str2double(get(hObject,'String')) returns contents of EMAY as a double

% --- Executes during object creation, after setting all properties.


function EMAY_CreateFcn(hObject, eventdata, handles)
% hObject handle to EMAY (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 A_Callback(hObject, eventdata, handles)


% hObject handle to A (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 A as text


% str2double(get(hObject,'String')) returns contents of A as a double

% --- Executes during object creation, after setting all properties.


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

You might also like