
Программа построения графического интерфейса пользователя MATLAB
1) Главная программа
global f PROZ SROK ISSUM REZSUM
PROZ=0;
SROK=0;
ISSUM=0;
REZSUM=0;
f=openfig('vvod1.fig','reuse');
2) Модуль экранной формы
function varargout = VVOD1(varargin)
% VVOD1 Application M-file for VVOD1.fig
% FIG = VVOD1 launch VVOD1 GUI.
% VVOD1('callback_name', ...) invoke the named callback.
% Last Modified by GUIDE v2.0 24-Apr-2003 16:00:22
if nargin == 0 % LAUNCH GUI
fig = openfig(mfilename,'reuse');
% Use system color scheme for figure:
set(fig,'Color',get(0,'defaultUicontrolBackgroundColor'));
% Generate a structure of handles to pass to callbacks, and store it.
handles = guihandles(fig);
guidata(fig, handles);
if nargout > 0
varargout{1} = fig;
end
elseif ischar(varargin{1}) % INVOKE NAMED SUBFUNCTION OR CALLBACK
try
[varargout{1:nargout}] = feval(varargin{:}); % FEVAL switchyard
catch
disp(lasterr);
end
end
% --------------------------------------------------------------------
function varargout = edit1_Callback(h, eventdata, handles, varargin)
% Stub for Callback of the uicontrol handles.edit1.
%disp('edit1 Callback not implemented yet.')
global PROZ
handles = guihandles(gcbo);
PROZ = str2double(get(handles.edit1,'String'));
% --------------------------------------------------------------------
function varargout = edit2_Callback(h, eventdata, handles, varargin)
% Stub for Callback of the uicontrol handles.edit2.
%disp('edit2 Callback not implemented yet.')
global SROK
handles = guihandles(gcbo);
SROK = str2double(get(handles.edit2,'String'));
% --------------------------------------------------------------------
function varargout = pushbutton1_ButtondownFcn(h, eventdata, handles, varargin)
% Stub for ButtondownFcn of the uicontrol handles.pushbutton1.
disp('pushbutton1 ButtondownFcn not implemented yet.')
% --------------------------------------------------------------------
function varargout = pushbutton1_Callback(h, eventdata, handles, varargin)
% Stub for Callback of the uicontrol handles.pushbutton1.
%disp('pushbutton1 Callback not implemented yet.')
global PROZ SROK ISSUM REZSUM
REZSUM=ISSUM*exp(SROK*log(1+0.01*PROZ));
handles = guihandles(gcbo);
set(handles.edit4,'String',num2str(REZSUM,’%15.2f’))
% --------------------------------------------------------------------
function varargout = edit3_Callback(h, eventdata, handles, varargin)
% Stub for Callback of the uicontrol handles.edit3.
%disp('edit3 Callback not implemented yet.')
global ISSUM
handles = guihandles(gcbo);
ISSUM = str2double(get(handles.edit3,'String'));
% --------------------------------------------------------------------
function varargout = edit4_Callback(h, eventdata, handles, varargin)
% Stub for Callback of the uicontrol handles.edit4.
%disp('edit4 Callback not implemented yet.')
Исходная сумма $
Значение процента
%
Срок
лет
РАССЧИТАТЬ
Накопление $
Вид экранной формы
Форма (класс-контейнер) включает 13 объектов: 1 кнопка (Button), 8 надписей (Label), 4 редактируемых окна (Edit).