Professional Documents
Culture Documents
OLEH
MARDIONO RAJAGUKGUK
1504115773
ILMU KELAUTAN
1.Kita membuka aplikasi matlab lalu mengetik guide dan mengklik oke
2.Lembar kerja kita akan terbuka
3. Kita akan menggunakan
- static text untuk membuat judul atau nama
-edit text untuk memasukan nilai pada lembar kerja kalkulator
- panel untuk membuat group
-slider untuk menentukan nilai dengan menggeser tombol pada slider
-axes untuk membuat grafik
-push button untuk membuat tombol pada lembar kerja kita / meng OK kan
4.Kemudian kita akan memasukan rumus dengan mengklik kanan pada push botton lalu memilih view
callbacks dan memilih callback, kemudi isi rumus
5. Lalu kita meRUN kan , masukan angka dan setelah selesai coba juga reset dan exit untuk melihat
apakah rumus kita benar
TERIMAKASIH
function varargout = MMMMMMM(varargin) % This function has no output args, see
% MMMMMMM M-file for MMMMMMM.fig OutputFcn.
% MMMMMMM, by itself, creates a new % hObject handle to figure
MMMMMMM or raises the existing % eventdata reserved - to be defined in a
% singleton*. future version of MATLAB
% % handles structure with handles and user
% H = MMMMMMM returns the handle to a data (see GUIDATA)
new MMMMMMM or the handle to % varargin command line arguments to
% the existing singleton*. MMMMMMM (see VARARGIN)
%
% % Choose default command line output for
MMMMMMM('CALLBACK',hObject,eventData,handles MMMMMMM
,...) calls the local handles.output = hObject;
% function named CALLBACK in MMMMMMM.M
with the given input arguments. % Update handles structure
% guidata(hObject, handles);
% MMMMMMM('Property','Value',...)
creates a new MMMMMMM or raises the % UIWAIT makes MMMMMMM wait for user
% existing singleton*. Starting from response (see UIRESUME)
the left, property value pairs are % uiwait(handles.figure1);
% applied to the GUI before
MMMMMMM_OpeningFcn gets called. An
% unrecognized property name or invalid % --- Outputs from this function are
value makes property application returned to the command line.
% stop. All inputs are passed to function varargout =
MMMMMMM_OpeningFcn via varargin. MMMMMMM_OutputFcn(hObject, eventdata,
% handles)
% *See GUI Options on GUIDE's Tools % varargout cell array for returning output
menu. Choose "GUI allows only one args (see VARARGOUT);
% instance to run (singleton)". % hObject handle to figure
% % eventdata reserved - to be defined in a
% See also: GUIDE, GUIDATA, GUIHANDLES future version of MATLAB
% handles structure with handles and user
% Edit the above text to modify the response data (see GUIDATA)
to help MMMMMMM
% Get default command line output from
% Last Modified by GUIDE v2.5 01-Jun-2016 handles structure
01:09:54 varargout{1} = handles.output;
ukaliv=(ivektoru.*ivektorv)+(jvektoru.*jvekt
orv); % --- Executes during object creation, after
panjangu=sqrt((ivektoru.^2)+(jvektoru.^2)); setting all properties.
panjangv=sqrt((ivektorv.^2)+(jvektorv.^2)); function edit5_CreateFcn(hObject, eventdata,
sudutuv=acosd((ukaliv)/(panjangu.*panjangv)) handles)
; % hObject handle to edit5 (see GCBO)
resultanuv=sqrt((panjangu^2)+(panjangv^2)+(2 % eventdata reserved - to be defined in a
*panjangu.*panjangv).*cosd(sudutuv)); future version of MATLAB
% handles empty - handles not created
x=[0,ivektoru]; until after all CreateFcns called
y=[0,jvektoru];
x1=[0,ivektorv]; % Hint: edit controls usually have a white
y1=[0,jvektorv]; background on Windows.
axes(handles.axes1); % See ISPC and COMPUTER.
plot(x,y,x1,y1); if ispc &&
legend('xi','xii','3'); isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor'))
% --- Executes on button press in set(hObject,'BackgroundColor','white');
pushbutton3. end
function pushbutton3_Callback(hObject,
eventdata, handles)
% hObject handle to pushbutton3 (see
GCBO) function edit6_Callback(hObject, eventdata,
% eventdata reserved - to be defined in a handles)
future version of MATLAB % hObject handle to edit6 (see GCBO)
% eventdata reserved - to be defined in a resultanuv=sqrt((panjangu^2)+(panjangv^2)+(2
future version of MATLAB *panjangu.*panjangv).*cosd(sudutuv));
% handles structure with handles and user % Hints: get(hObject,'String') returns
data (see GUIDATA) contents of edit7 as text
ivektoru=str2double(get(handles.edit1,'Strin % str2double(get(hObject,'String'))
g')); returns contents of edit7 as a double
jvektoru=str2double(get(handles.edit2,'Strin
g'));
ivektorv=str2double(get(handles.edit3,'Strin % --- Executes during object creation, after
g')); setting all properties.
jvektorv=str2double(get(handles.edit4,'Strin function edit7_CreateFcn(hObject, eventdata,
g')); handles)
% hObject handle to edit7 (see GCBO)
ukaliv=(ivektoru.*ivektorv)+(jvektoru.*jvekt % eventdata reserved - to be defined in a
orv); future version of MATLAB
panjangu=sqrt((ivektoru.^2)+(jvektoru.^2)); % handles empty - handles not created
panjangv=sqrt((ivektorv.^2)+(jvektorv.^2)); until after all CreateFcns called
sudutuv=acosd((ukaliv)/(panjangu.*panjangv))
; % Hint: edit controls usually have a white
resultanuv=sqrt((panjangu^2)+(panjangv^2)+(2 background on Windows.
*panjangu.*panjangv).*cosd(sudutuv)); % See ISPC and COMPUTER.
% Hints: get(hObject,'String') returns if ispc &&
contents of edit6 as text isequal(get(hObject,'BackgroundColor'),
% str2double(get(hObject,'String')) get(0,'defaultUicontrolBackgroundColor'))
returns contents of edit6 as a double set(hObject,'BackgroundColor','white');
end
% --- Executes during object creation, after % --- Executes during object creation, after
setting all properties. setting all properties.
function edit47_CreateFcn(hObject, function edit49_CreateFcn(hObject,
eventdata, handles) eventdata, handles)
% hObject handle to edit47 (see GCBO) % hObject handle to edit49 (see GCBO)
% eventdata reserved - to be defined in a % eventdata reserved - to be defined in a
future version of MATLAB future version of MATLAB
% handles empty - handles not created % handles empty - handles not created
until after all CreateFcns called until after all CreateFcns called
% Hint: edit controls usually have a white % Hint: edit controls usually have a white
background on Windows. background on Windows.
% See ISPC and COMPUTER. % See ISPC and COMPUTER.
if ispc && if ispc &&
isequal(get(hObject,'BackgroundColor'), isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor')) get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white'); set(hObject,'BackgroundColor','white');
end end
% --- Executes during object creation, after % --- Executes during object creation, after
setting all properties. setting all properties.
function edit48_CreateFcn(hObject, function edit50_CreateFcn(hObject,
eventdata, handles) eventdata, handles)
% hObject handle to edit48 (see GCBO) % hObject handle to edit50 (see GCBO)
% eventdata reserved - to be defined in a % eventdata reserved - to be defined in a
future version of MATLAB future version of MATLAB
% handles empty - handles not created % handles empty - handles not created
until after all CreateFcns called until after all CreateFcns called
% Hint: edit controls usually have a white % Hint: edit controls usually have a white
background on Windows. background on Windows.
% See ISPC and COMPUTER. % See ISPC and COMPUTER.
if ispc && if ispc &&
isequal(get(hObject,'BackgroundColor'), isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor')) get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white'); set(hObject,'BackgroundColor','white');
end end
% --- Executes during object creation, after % --- Executes during object creation, after
setting all properties. setting all properties.
function edit51_CreateFcn(hObject, function edit42_CreateFcn(hObject,
eventdata, handles) eventdata, handles)
% hObject handle to edit51 (see GCBO) % hObject handle to edit42 (see GCBO)
% eventdata reserved - to be defined in a % eventdata reserved - to be defined in a
future version of MATLAB future version of MATLAB
% handles empty - handles not created % handles empty - handles not created
until after all CreateFcns called until after all CreateFcns called
% Hint: edit controls usually have a white % Hint: edit controls usually have a white
background on Windows. background on Windows.
% See ISPC and COMPUTER. % See ISPC and COMPUTER.
if ispc && if ispc &&
isequal(get(hObject,'BackgroundColor'), isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor')) get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white'); set(hObject,'BackgroundColor','white');
end end
% --- Executes during object creation, after % --- Executes during object creation, after
setting all properties. setting all properties.
function edit52_CreateFcn(hObject, function edit43_CreateFcn(hObject,
eventdata, handles) eventdata, handles)
% hObject handle to edit52 (see GCBO) % hObject handle to edit43 (see GCBO)
% eventdata reserved - to be defined in a % eventdata reserved - to be defined in a
future version of MATLAB future version of MATLAB
% handles empty - handles not created % handles empty - handles not created
until after all CreateFcns called until after all CreateFcns called
% Hint: edit controls usually have a white % Hint: edit controls usually have a white
background on Windows. background on Windows.
% See ISPC and COMPUTER. % See ISPC and COMPUTER.
if ispc && if ispc &&
isequal(get(hObject,'BackgroundColor'), isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor')) get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white'); set(hObject,'BackgroundColor','white');
end end
% --- Executes during object creation, after % --- Executes during object creation, after
setting all properties. setting all properties.
function edit44_CreateFcn(hObject, function edit46_CreateFcn(hObject,
eventdata, handles) eventdata, handles)
% hObject handle to edit44 (see GCBO) % hObject handle to edit46 (see GCBO)
% eventdata reserved - to be defined in a % eventdata reserved - to be defined in a
future version of MATLAB future version of MATLAB
% handles empty - handles not created % handles empty - handles not created
until after all CreateFcns called until after all CreateFcns called
% Hint: edit controls usually have a white % Hint: edit controls usually have a white
background on Windows. background on Windows.
% See ISPC and COMPUTER. % See ISPC and COMPUTER.
if ispc && if ispc &&
isequal(get(hObject,'BackgroundColor'), isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor')) get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white'); set(hObject,'BackgroundColor','white');
end end
% --- Executes during object creation, after % --- Executes during object creation, after
setting all properties. setting all properties.
function edit45_CreateFcn(hObject, function edit38_CreateFcn(hObject,
eventdata, handles) eventdata, handles)
% hObject handle to edit45 (see GCBO) % hObject handle to edit38 (see GCBO)
% eventdata reserved - to be defined in a % eventdata reserved - to be defined in a
future version of MATLAB future version of MATLAB
% handles empty - handles not created % handles empty - handles not created
until after all CreateFcns called until after all CreateFcns called
% Hint: edit controls usually have a white % Hint: edit controls usually have a white
background on Windows. background on Windows.
% See ISPC and COMPUTER. % See ISPC and COMPUTER.
if ispc && if ispc &&
isequal(get(hObject,'BackgroundColor'), isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor')) get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white'); set(hObject,'BackgroundColor','white');
end end
% --- Executes during object creation, after % --- Executes during object creation, after
setting all properties. setting all properties.
function edit39_CreateFcn(hObject, function edit41_CreateFcn(hObject,
eventdata, handles) eventdata, handles)
% hObject handle to edit39 (see GCBO) % hObject handle to edit41 (see GCBO)
% eventdata reserved - to be defined in a % eventdata reserved - to be defined in a
future version of MATLAB future version of MATLAB
% handles empty - handles not created % handles empty - handles not created
until after all CreateFcns called until after all CreateFcns called
% Hint: edit controls usually have a white % Hint: edit controls usually have a white
background on Windows. background on Windows.
% See ISPC and COMPUTER. % See ISPC and COMPUTER.
if ispc && if ispc &&
isequal(get(hObject,'BackgroundColor'), isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor')) get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white'); set(hObject,'BackgroundColor','white');
end end
% --- Executes during object creation, after % --- Executes during object creation, after
setting all properties. setting all properties.
function edit2_CreateFcn(hObject, eventdata, function edit57_CreateFcn(hObject,
handles) eventdata, handles)
% hObject handle to edit2 (see GCBO) % hObject handle to edit57 (see GCBO)
% eventdata reserved - to be defined in a % eventdata reserved - to be defined in a
future version of MATLAB future version of MATLAB
% handles empty - handles not created % handles empty - handles not created
until after all CreateFcns called until after all CreateFcns called
% Hint: edit controls usually have a white % Hint: edit controls usually have a white
background on Windows. background on Windows.
% See ISPC and COMPUTER. % See ISPC and COMPUTER.
if ispc && if ispc &&
isequal(get(hObject,'BackgroundColor'), isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor')) get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white'); set(hObject,'BackgroundColor','white');
end end
% --- Executes during object creation, after % --- Executes during object creation, after
setting all properties. setting all properties.
function edit56_CreateFcn(hObject, function edit58_CreateFcn(hObject,
eventdata, handles) eventdata, handles)
% hObject handle to edit56 (see GCBO) % hObject handle to edit58 (see GCBO)
% eventdata reserved - to be defined in a % eventdata reserved - to be defined in a
future version of MATLAB future version of MATLAB
% handles empty - handles not created % handles empty - handles not created
until after all CreateFcns called until after all CreateFcns called
% Hint: edit controls usually have a white % Hint: edit controls usually have a white
background on Windows. background on Windows.
% See ISPC and COMPUTER. % See ISPC and COMPUTER.
if ispc && if ispc &&
isequal(get(hObject,'BackgroundColor'), isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor')) get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white'); set(hObject,'BackgroundColor','white');
end end