Beruflich Dokumente
Kultur Dokumente
OLEH :
KELOMPOK 1
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State,
varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT
proyek=guidata(gcbo);
f=get(proyek.efungsi,'String');
axes(proyek.axes1)
ezplot(f)
set(proyek.axes1,'XMinorTick','on')
grid on
close
function exmin_Callback(hObject, eventdata, handles)
% hObject handle to exmin (see GCBO)
% eventdata reserved - to be defined in a future version of
MATLAB
% handles structure with handles and user data (see
GUIDATA)
3. Setelah itu klik RUN pada script dan GUI, lalu masukkan fungsi sin(x) maka
akan muncul tampila GUI sesuai yang diinginkan seperti berikut :
B. Membuat Grafik Sinus dengan Interval
1. Buatlah GUI untuk grafik sinus dengan interval pada Matlab seperti gambar
berikut :
2. Kemudian buat script pada new script seperti berikut :
function varargout = grafik2(varargin)
% GRAFIK2 MATLAB code for grafik2.fig
% GRAFIK2, by itself, creates a new GRAFIK2 or raises
the existing
% singleton*.
%
% H = GRAFIK2 returns the handle to a new GRAFIK2 or the
handle to
% the existing singleton*.
%
% GRAFIK2('CALLBACK',hObject,eventData,handles,...)
calls the local
% function named CALLBACK in GRAFIK2.M with the given
input arguments.
%
% GRAFIK2('Property','Value',...) creates a new GRAFIK2
or raises the
% existing singleton*. Starting from the left, property
value pairs are
% applied to the GUI before grafik2_OpeningFcn gets
called. An
% unrecognized property name or invalid value makes
property application
% stop. All inputs are passed to grafik2_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
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State,
varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT
proyek=guidata(gcbo);
f=get(proyek.efungsi,'String');
x1=str2num(get(proyek.exmin,'String'));
x2=str2num(get(proyek.exmax,'String'));
set(proyek.axes1,'xLim',[x1 x2])
ezplot(f,[x1 x2])
grid on
%proyek=guidata(gcbo);
%f=get(proyek.efungsi,'String');
%axes(proyek.axes1)
%ezplot(f)
%set(proyek.axes1,'XMinorTick','on')
%grid on
3. Setelah itu klik RUN pada script dan GUI, lalu masukkan fungsi sin(x) dan
berikan nilai untuk x maximum dan minimum. Maka akan muncul tampilan
GUI sesuai yang diinginkan seperti berikut :
C. Membuat Tampilan Depan dan Menu
1. Buatlah GUI untuk tampilan depan dan menu pada Matlab seperti gambar
berikut :
2. Kemudian buat script pada new script seperti berikut :
function varargout = Depan(varargin)
% DEPAN MATLAB code for Depan.fig
% DEPAN, by itself, creates a new DEPAN or raises the
existing
% singleton*.
%
% H = DEPAN returns the handle to a new DEPAN or the
handle to
% the existing singleton*.
%
% DEPAN('CALLBACK',hObject,eventData,handles,...) calls
the local
% function named CALLBACK in DEPAN.M with the given
input arguments.
%
% DEPAN('Property','Value',...) creates a new DEPAN or
raises the
% existing singleton*. Starting from the left, property
value pairs are
% applied to the GUI before Depan_OpeningFcn gets
called. An
% unrecognized property name or invalid value makes
property application
% stop. All inputs are passed to Depan_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
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State,
varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT
%
-------------------------------------------------------------
-------
function Untitled_1_Callback(hObject, eventdata, handles)
% hObject handle to out (see GCBO)
% eventdata reserved - to be defined in a future version of
MATLAB
% handles structure with handles and user data (see
GUIDATA)
%
-------------------------------------------------------------
-------
function bantuan_Callback(hObject, eventdata, handles)
% hObject handle to bantuan (see GCBO)
% eventdata reserved - to be defined in a future version of
MATLAB
% handles structure with handles and user data (see
GUIDATA)
bantuan
%
-------------------------------------------------------------
-------
function out_Callback(hObject, eventdata, handles)
% hObject handle to out (see GCBO)
% eventdata reserved - to be defined in a future version of
MATLAB
% handles structure with handles and user data (see
GUIDATA)
grafik
%
-------------------------------------------------------------
-------
function intrv_Callback(hObject, eventdata, handles)
% hObject handle to intrv (see GCBO)
% eventdata reserved - to be defined in a future version of
MATLAB
% handles structure with handles and user data (see
GUIDATA)
grafik2
3. Setelah itu klik RUN pada script dan GUI, maka akan muncul tampilan GUI
sesuai yang diinginkan seperti berikut :