Sie sind auf Seite 1von 6

TUGAS METODE NUMERIK UNTUK REKAYASA

‘’MEMBUAT PROGRAM WATERLINE DENGAN MENGGUNAKAN GUI PADA

MATLAB”

OLEH :

1. SANIYYAH DEVI PITALOKA (04111740000019)


2. PRAMUDYA ULUL AZMINULLOH (04111740000020)
3. KEVIN LYPUTRA (04111740000022)

DOSEN :
HASANUDIN, ST., MT

DEPARTEMEN TEKNIK PERKAPALAN


FAKULTAS TEKNOLOGI KELAUTAN
INSTITUT TEKNOLOGI SEPULUH NOPEMBER SURARBAYA
TAHUN 2018/ 2019
A. PLOT KORDINAT
function Plotkoordinat_Callback(hObject, eventdata, handles)
x1=str2num(get(handles.InputX1,'String'));
y1=str2num(get(handles.InputY1,'String'));
plot(x1,y1);
plot(x1,-y1);
hold on;
x2=str2num(get(handles.InputX2,'String'));
y2=str2num(get(handles.InputY2,'String'));
plot(x2,y2);
plot(x2,-y2);
hold on;
x3=str2num(get(handles.InputX3,'String'));
y3=str2num(get(handles.InputY3,'String'));
plot(x3,y3);
plot(x3,-y3);

z1= (polyfit(x1,y1,5));
syms x
y1=poly2sym(z1,x);
ft1=matlabFunction(y1);
set(handles.Pers1,'String',func2str(ft1));

z2= (polyfit(x2,y2,5));
syms x
y2=poly2sym(z2,x);
ft2=matlabFunction(y2);
set(handles.Pers2,'String',func2str(ft2));

z3= (polyfit(x3,y3,5));
syms x
y3=poly2sym(z3,x);
ft3=matlabFunction(y3);
set(handles.Pers3,'String',func2str(ft3));
% hObject handle to Plotkoordinat (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

B. PLOT AWP

function CallAWP_Callback(hObject, eventdata, handles)


syms x
Persamaan1 = str2func(get(handles.Pers1,'String'));
Lmin1 = str2num(get(handles.Lmin1,'String'));
Lmax1 = str2num(get(handles.Lmax1,'String'));
Setengahluas1 = integral(Persamaan1,Lmin1,Lmax1);
Luas1 = 2*Setengahluas1;
set(handles.AWP1,'String',num2str(Luas1));

syms x
Persamaan2 = str2func(get(handles.Pers2,'String'));
Lmin2 = str2num(get(handles.Lmin2,'String'));
Lmax2 = str2num(get(handles.Lmax2,'String'));
Setengahluas2 = integral(Persamaan2,Lmin2,Lmax2);
Luas2 = 2*Setengahluas2;
set(handles.AWP2,'String',num2str(Luas2));

syms x
Persamaan3 = str2func(get(handles.Pers3,'String'));
Lmin3 = str2num(get(handles.Lmin3,'String'));
Lmax3 = str2num(get(handles.Lmax3,'String'));
Setengahluas3 = integral(Persamaan3,Lmin3,Lmax3);
Luas3 = 2*Setengahluas3;
set(handles.AWP3,'String',num2str(Luas3));
% hObject handle to CallAWP (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

C. PLOT VOLUME

function Plotvol_Callback(hObject, eventdata, handles)


syms x
fs1 = 1
fs2 = 4
fs3 = 1
h = str2num(get(handles.Jarakwl,'String'))
fsh1 = fs1*h
fsh2 = fs2*h
fsh3 = fs3*h
WPA1 = str2num(get(handles.AWP1,'String'))
WPA2 = str2num(get(handles.AWP2,'String'))
WPA3 = str2num(get(handles.AWP3,'String'))
fshwpa1 = fsh1*WPA1
fshwpa2 = fsh2*WPA2
fshwpa3 = fsh3*WPA3
vtot = 1/6*(fshwpa1+fshwpa2+fshwpa3)

set(handles.Vol,'String',num2str(vtot))
% hObject handle to Plotvol (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

D. PLOT CLEAR

function Plotclear_Callback(hObject, eventdata, handles)


cla
% hObject handle to Plotclear (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
E. TITIK KORDINAT (X, Y) PADA KAPAL