OPTIMASI PEMOTONGAN ROL KERTAS DUA DIMENSI DENGAN MENGGUNAKAN PROGRAM LINEAR Tugas Akhir Diajukan untuk Memenuhi Salah Satu Syarat Memperoleh Gelar Sarjana Sains Program Studi Matematika Oleh: Andreas Irawan Susanto NIM : 133114020 PROGRAM STUDI MATEMATIKA, JURUSAN MATEMATIKA FAKULTAS SAINS DAN TEKNOLOGI UNIVERSITAS SANATA DHARMA YOGYAKARTA 2017 PLAGIAT MERUPAKAN TINDAKAN TIDAK TERPUJI
114
Embed
OPTIMASI PEMOTONGAN ROL KERTAS DUA DIMENSI DENGAN ... · program dan GUI MATLAB. Tujuan dibuat GUI MATLAB adalah Tujuan dibuat GUI MATLAB adalah mempermudah setiap orang menggunakan
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
i
OPTIMASI PEMOTONGAN ROL KERTAS DUA DIMENSI
DENGAN MENGGUNAKAN PROGRAM LINEAR
Tugas Akhir
Diajukan untuk Memenuhi Salah Satu Syarat
Memperoleh Gelar Sarjana Sains
Program Studi Matematika
Oleh:
Andreas Irawan Susanto
NIM : 133114020
PROGRAM STUDI MATEMATIKA, JURUSAN MATEMATIKA
FAKULTAS SAINS DAN TEKNOLOGI
UNIVERSITAS SANATA DHARMA
YOGYAKARTA
2017
PLAGIAT MERUPAKAN TINDAKAN TIDAK TERPUJI
ii
OPTIMIZING CUTTING PAPER ROLLS TWO
DIMENSIONAL USING LINEAR PROGRAMING
A Thesis
Presented as a Partial Fulfillment of the
Requirements to Obtain the Degree of Sarjana Sains
% UIWAIT makes GUISkripsi wait for user response (see UIRESUME) % uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line. function varargout = GUISkripsi_OutputFcn(hObject, eventdata, han-
dles) % 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;
% --- Executes on button press in CekHasil. function CekHasil_Callback(hObject, eventdata, handles) % hObject handle to CekHasil (see GCBO) % eventdata reserved - to be defined in a future version of
MATLAB % handles structure with handles and user data (see GUIDATA) %ABB=[23 26;30 32;900 92;800 32]; %AB=set(handles.Tabel1,'Data',ABB); global xS k %digunakan untuk menyimpan variabel secara keseluruhan %untuk mengambil nilai dari Banyaknya kertas Permintaan Bm=get(handles.edit7,'String'); Bm11=str2num(Bm); AAA1=get(handles.Tabel1,'Data'); %Untuk mengambil nilai pada Tabel %untuk mengambil nilai dari Lebar Kertas Permintaan b1b=AAA1(1,1:Bm11); for ab1=1:Bm11 b(ab1)=cell2mat(b1b(ab1)); end %untuk mengambil nilai dari Lebar rol kertas Bma=get(handles.Bmaxx1,'String');
PLAGIAT MERUPAKAN TINDAKAN TIDAK TERPUJI
Bmax=str2num(Bma); %untuk mengambil nilai dari Lebar Minimum Pemotongan Kertas Bmi=get(handles.Bminn1,'String'); Bmin=str2num(Bmi); proses1 %untuk mengambil nilai dari Panjang Lembaran Kertas Permintaan
(wi) l11=AAA1(2,:); for ab1=1:Bm11 l(ab1)=cell2mat(l11(ab1)); end %untuk mengambil nilai dari Batas Atas Permintaan lmax11=AAA1(3,1:Bm11); for ab1=1:Bm11 lmax(ab1)=cell2mat(lmax11(ab1)); end %untuk mengambil nilai dari Batas Bawah Permintaan lmin11=AAA1(4,1:Bm11); for ab1=1:Bm11 lmin(ab1)=cell2mat(lmin11(ab1)); end %untuk mengambil nilai dari banyknya rol kertas produksi (r) k22=get(handles.kk1,'String'); k=str2num(k22); %untuk mengambil nilai dari Panjang Rol Kertas L2=get(handles.LL1,'String'); L=str2num(L2); %untuk mengambil nilai dari Panjang Minimum Pemotongan Pmin2=get(handles.Pminn1,'String'); Pmin=str2num(Pmin2); %untuk mengambil nilai dari sisa panjang rol kertas ketika meng-
ganti ke rol kertas berikutnya (S) S2=get(handles.SS1,'String'); S=str2num(S2); proses2 %Jika program linear tidak ada hasil if length(xS)==0 TidakAdaHasil end %untuk memasukan Banyak rol yang digunakan dan sisa pemotongan total1=sum(f.*xS); ccc1=num2str(total1); set(handles.Zmin,'String',ccc1) xYk=xS(1:k,1)'; total2=sum(xYk); ccc2=num2str(total2); set(handles.Ykk1,'String',ccc2)
function Bmaxx1_Callback(hObject, eventdata, handles) % hObject handle to Bmaxx1 (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 Bmaxx1 as text
PLAGIAT MERUPAKAN TINDAKAN TIDAK TERPUJI
% str2double(get(hObject,'String')) returns contents of
Bmaxx1 as a double
% --- Executes during object creation, after setting all proper-
ties. function Bmaxx1_CreateFcn(hObject, eventdata, handles) % hObject handle to Bmaxx1 (see GCBO) % eventdata reserved - to be defined in a future version of
MATLAB % handles empty - handles not created until after all Cre-
ateFcns called input=str2num(get(hObject,'String')); % 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 Bminn1_Callback(hObject, eventdata, handles) % hObject handle to Bminn1 (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 Bminn1 as text % str2double(get(hObject,'String')) returns contents of
Bminn1 as a double
% --- Executes during object creation, after setting all proper-
ties. function Bminn1_CreateFcn(hObject, eventdata, handles) % hObject handle to Bminn1 (see GCBO) % eventdata reserved - to be defined in a future version of
MATLAB % handles empty - handles not created until after all Cre-
ateFcns called input=str2num(get(hObject,'String')); % 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 kk1_Callback(hObject, eventdata, handles) % hObject handle to kk1 (see GCBO)
PLAGIAT MERUPAKAN TINDAKAN TIDAK TERPUJI
% 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 kk1 as text % str2double(get(hObject,'String')) returns contents of kk1
as a double
% --- Executes during object creation, after setting all proper-
ties. function kk1_CreateFcn(hObject, eventdata, handles) % hObject handle to kk1 (see GCBO) % eventdata reserved - to be defined in a future version of
MATLAB % handles empty - handles not created until after all Cre-
ateFcns called input=str2num(get(hObject,'String')); % 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 LL1_Callback(hObject, eventdata, handles) % hObject handle to LL1 (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 LL1 as text % str2double(get(hObject,'String')) returns contents of LL1
as a double
% --- Executes during object creation, after setting all proper-
ties. function LL1_CreateFcn(hObject, eventdata, handles) % hObject handle to LL1 (see GCBO) % eventdata reserved - to be defined in a future version of
MATLAB % handles empty - handles not created until after all Cre-
ateFcns called input=str2num(get(hObject,'String')); % 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
PLAGIAT MERUPAKAN TINDAKAN TIDAK TERPUJI
function Pminn1_Callback(hObject, eventdata, handles) % hObject handle to Pminn1 (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 Pminn1 as text % str2double(get(hObject,'String')) returns contents of
Pminn1 as a double
% --- Executes during object creation, after setting all proper-
ties. function Pminn1_CreateFcn(hObject, eventdata, handles) % hObject handle to Pminn1 (see GCBO) % eventdata reserved - to be defined in a future version of
MATLAB % handles empty - handles not created until after all Cre-
ateFcns called input=str2num(get(hObject,'String')); % 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 SS1_Callback(hObject, eventdata, handles) % hObject handle to SS1 (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 SS1 as text % str2double(get(hObject,'String')) returns contents of SS1
as a double
% --- Executes during object creation, after setting all proper-
ties. function SS1_CreateFcn(hObject, eventdata, handles) % hObject handle to SS1 (see GCBO) % eventdata reserved - to be defined in a future version of
MATLAB % handles empty - handles not created until after all Cre-
ateFcns called input=str2num(get(hObject,'String')); % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER.
PLAGIAT MERUPAKAN TINDAKAN TIDAK TERPUJI
if ispc && isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end
% --- Executes when entered data in editable cell(s) in Tabel1. function Tabel1_CellEditCallback(hObject, eventdata, handles) % hObject handle to Tabel1 (see GCBO) % eventdata structure with the following fields (see
MATLAB.UI.CONTROL.TABLE) % Indices: row and column indices of the cell(s) edited % PreviousData: previous data for the cell(s) edited % EditData: string(s) entered by the user % NewData: EditData or its converted form set on the Data prop-
erty. Empty if Data was not changed % Error: error string when failed to convert EditData to appro-
priate value for Data % handles structure with handles and user data (see GUIDATA) AAA1=get(hObject,'Data');
% --- Executes on selection change in popupmenu3. function popupmenu3_Callback(hObject, eventdata, handles) % hObject handle to popupmenu3 (see GCBO) % eventdata reserved - to be defined in a future version of
MATLAB % handles structure with handles and user data (see GUIDATA)
popupmenu3 contents as cell array % contents{get(hObject,'Value')} returns selected item from
popupmenu3 switch get (handles.popupmenu3,'Value') case 1
case 2 close DetailGuiSkripsi case 3 close; otherwise end
% --- Executes during object creation, after setting all proper-
ties. function popupmenu3_CreateFcn(hObject, eventdata, handles) % hObject handle to popupmenu3 (see GCBO) % eventdata reserved - to be defined in a future version of
MATLAB % handles empty - handles not created until after all Cre-
ateFcns called input=str2num(get(hObject,'String'));
PLAGIAT MERUPAKAN TINDAKAN TIDAK TERPUJI
% Hint: popupmenu controls usually have a white background on Win-
dows. % See ISPC and COMPUTER. if ispc && isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end
function edit7_Callback(hObject, eventdata, handles) % hObject handle to edit7 (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 edit7 as text % str2double(get(hObject,'String')) returns contents of ed-
it7 as a double
% --- Executes during object creation, after setting all proper-
ties. function edit7_CreateFcn(hObject, eventdata, handles) % hObject handle to edit7 (see GCBO) % eventdata reserved - to be defined in a future version of
MATLAB % handles empty - handles not created until after all Cre-
ateFcns called input=str2num(get(hObject,'String')); % 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
PLAGIAT MERUPAKAN TINDAKAN TIDAK TERPUJI
Lampiran 2: List Program Proses 1 (Mencari Pola Pemotongan)
global a j A1 %digunakan untuk menyimpan variabel secara kese-
luruhan i=1; a=length(b); Nmax=4; nmax(i)= 4; n=zeros(1,a); N=zeros(1,a+1); B=zeros(1,a+1); %kelompok 0 j=1; while i>0 %kelompom 1 iya maka jalan, tidak maka berhenti j=j+1; n(j,:)=n(j-1,:); if b*n(j,:)'>=Bmin % Kelompok 2 N(1)=0; B(1)=0; for i=1:a N(i+1)=N(i)+n(j,i); B(i+1)=B(i)+b(i)*n(j,i); nmax(i)=min(Nmax-N(i),floor(max(0,(Bmax-B(i))/b(i)))); end i=a;
while n(j,i)< nmax(i)%kelompok 3 untuk yang tidak n(j,i)=n(j,i)+1; if b*n(j,:)'< Bmin %kelompok 4 untuk jawaban tidak %kelompok 3 N(1)=0; B(1)=0; for i=1:a N(i+1)=N(i)+n(j,i); B(i+1)=B(i)+b(i)*n(j,i); nmax(i)=min(Nmax-N(i),floor(max(0,(Bmax-
B(i))/b(i)))); end i=a; elseif b*n(j,:)'>= Bmin %kelompok 4 untuk jawaban tidak %kelompok 1 j=j+1; n(j,:)=n(j-1,:); %kelompok 2 N(1)=0; B(1)=0; for i=1:a N(i+1)=N(i)+n(j,i); B(i+1)=B(i)+b(i)*n(j,i); nmax(i)=min(Nmax-N(i),floor(max(0,(Bmax-
B(i))/b(i)))); end i=a; end aaaa= n(j,i);
PLAGIAT MERUPAKAN TINDAKAN TIDAK TERPUJI
bbbb=nmax(i); end %atas pasti salah ( 5 yes) while n(j,i)>= nmax(i)%kelompok 3 untuk jawaban iya if n(j,i)>= nmax(i) %kelompok 6 n(j,i)=0; i=i-1; if i<=0 %kelompok 6 untuk jawaban tidak break end end end if i<=0 %untuk menghentikan jika i<=0 break end %kelompok 4 n(j,i)=n(j,i)+1; end
while b*n(j,:)'< Bmin %kelompok 4 untuk jawaban iya %kelompok 2 N(1)=0; B(1)=0; for i=1:a N(i+1)=N(i)+n(j,i); B(i+1)=B(i)+b(i)*n(j,i); nmax(i)=min(Nmax-N(i),floor(max(0,(Bmax-B(i))/b(i)))); end i=a; while n(j,i)< nmax(i)%kelompok 3 untuk jawaban tidak %kelompok 4 n(j,i)=n(j,i)+1; if b*n(j,:)'< Bmin %kelompok 4 untuk jawaban iya %kelopok 2 N(1)=0; B(1)=0; for i=1:a N(i+1)=N(i)+n(j,i); B(i+1)=B(i)+b(i)*n(j,i); nmax(i)=min(Nmax-N(i),floor(max(0,(Bmax-
B(i))/b(i)))); end i=a; elseif b*n(j,:)'>= Bmin %kelompok 4 untuk jawaban tidak %kelompok 1 j=j+1; n(j,:)=n(j-1,:); %kelompok 2 N(1)=0; B(1)=0; for i=1:a N(i+1)=N(i)+n(j,i); B(i+1)=B(i)+b(i)*n(j,i);
PLAGIAT MERUPAKAN TINDAKAN TIDAK TERPUJI
nmax(i)=min(Nmax-N(i),floor(max(0,(Bmax-
B(i))/b(i)))); end i=a; end end while n(j,i)>= nmax(i)%kelompok 3 untuk jawaban iya if n(j,i)>= nmax(i) %kelompok 6 n(j,i)=0; i=i-1; if i<=0 %untuk menghentikan break end end end if i<=0 %untuk menghentikan break end n(j,i)=n(j,i)+1; end end %karena hasil dari program diatas ada yang pola yang menggunakan
lbh dari 2 kertas diperlukan langkah di bawah untuk menghapusnya for c=1:j d(c)=b*n(c,:)'; end g=1; for c=1:j d(c)=b*n(c,:)'; if Bmin<= d(c)& d(c)<=Bmax A11(g,1:a)=n(c,:); B1(g)=c; C(g)=b*n(c,:)'; g=g+1; else end end for c=1:length(B1) D(c,1:a)=n(B1(c),:); end v=1;d=1; for c=1:g-1 ff=find(A11(c,:)>0); if length(ff)==1 A1(v,1:a)=A11(c,1:a); v=v+1; elseif length(ff)==2 A1(v,1:a)=A11(c,1:a); v=v+1; else A12(d,1:a)=A11(c,1:a); d=d+1; end end g1=length(A1(:,1));
PLAGIAT MERUPAKAN TINDAKAN TIDAK TERPUJI
Lampiran 4: List Program Proses 2 (Membuat Kendala dan Me-
nyelesaikan)
global j xS %digunakan untuk menyimpan variabel secara keseluruhan j=g1; %Banyaknya pola pemotongan (J) Wmax=Bmax;%menyamakan simbol w=b;%menyamakan simbol %membuat tempat untuk variabel berikut p=ones(j,k);%pjk x=ones(j,k);%xj i nya belum ada ai=ones(1,a);%ai y=ones(j,k);%yjk Y=ones(1,k);%Yk sp=ones(1,a);%si+ sn=ones(1,a);%si- F1=Y*0;F2=zeros(1,j*k);F3=ai*0;F4=sn*0;F5=sp*0;F6=zeros(1,j*k);F7=
zeros(1,j*k*a); %membuat fungsi tujuan F=[Y*Wmax*L,F2,-(ai.*w),F4,sp.*w,F6,F7]; f =F'; intcon = length(F); %membuat kendala 2 for c=1:k ap(c,(c-1)*j+1:c*j)=p(:,c)'; ay(c,(c-1)*j+1:c*j)=y(:,c)'; aY=eye(k); end for c=1:k k1(c,1:intcon)=[-L*aY(c,:),S*ay(c,:),F3,F4,F5,ap(c,:),F7]; end %membuat kendala 3 g=0; for c=1:k for d=1:j g=g+1; ap=F6;ay=F2; ap(1,(c-1)*j+d)=1; ay(1,(c-1)*j+d)=1; k2(g,1:intcon)=[F1,-L*ay,F3,F4,F5,ap,F7]; end end
%membuat kendala 4 g=0; for c=1:k for d=1:j g=g+1; ap=F6;ay=F2; ap(1,(c-1)*j+d)=1; ay(1,(c-1)*j+d)=1; k3(g,1:intcon)=[F1,Pmin*ay,F3,F4,F5,-ap,F7]; end end
%membuat kendala 6 for c=1:a aai=F3; aai(c)=1;
PLAGIAT MERUPAKAN TINDAKAN TIDAK TERPUJI
k4(c,1:intcon)=[F1,F2,-aai,F4,F5,F6,F7]; end g=0; I=eye(a*j*k);
%memebuat kendala 8 for c=1:k for d=1:j ap=F6;ax=F7; ap(1,(c-1)*j+d)=1; for z=1:a g=g+1; k5(g,1:intcon)=[F1,F2,F3,F4,F5,-ap,l(z)*I(g,:)]; end end end %membuat kendala 9 for c=1:k-1 aY=F1; aY(1,c)=-1; aY(1,c+1)=1; k6(c,1:intcon)=[aY,F2,F3,F4,F5,F6,F7]; end %membuat kendala yang memiliki persamaan <= A = [k1;k2;k3;k4;k5;k6]; [a1,b1]=size(k1);[a2,b2]=size(k2);[a3,b3]=size(k3);[a4,b4]=size(k4
);[a5,b5]=size(k5);[a6,b6]=size(k6); b = [zeros(a1,1);zeros(a2,1);zeros(a3,1);-
lmin';zeros(a5,1);zeros(a6,1)]; aai=eye(a); xx=eye(a); ax=zeros(a,a*j*k); A1k=ax'; for d=1:j*k ax(1:a,1+(d-1)*a:d*a)=xx; end aA1=ax; for c=1:k A1k(j*(c-1)+1:j*c,:)=A1; end for c=1:a h=0; NL=find(ax(c,:)); for z=1:length(NL) h=h+1; aA1(c,NL(z))=aA1(c,NL(z))*A1k(h,c); end end %memebuat kendala 5 for z=1:a k7(z,1:intcon)=[F1,F2,-
aai(z,:),F4,F5,F6,l(z)*ax(z,:).*aA1(z,:)]; end %membuat kendala 7 asp=eye(a);asn=eye(a); for z=1:a k8(z,1:intcon)=[F1,F2,aai(z,:),asp(z,:),-asn(z,:),F6,F7];
PLAGIAT MERUPAKAN TINDAKAN TIDAK TERPUJI
end %membuat kendala yang memiliki persamaan = Aeq = [k7;k8]; [a7,b7]=size(k7);[a8,b8]=size(k8); beq = [zeros(a7,1);lmax']; lb = [F1';F2';F3';F4';F5';F6';F7']; ub =
F7+1)'*inf]; %menentukan variabel keputusan yang hasilnya harus bulat ccc=[1:k+j*k,k+2*j*k+3*a+1:k+2*j*k+3*a+j*k*a]; %menyelesaikan persamaan yang telah dibuat xS = intlinprog(f,ccc,A,b,Aeq,beq,lb,ub);
PLAGIAT MERUPAKAN TINDAKAN TIDAK TERPUJI
Lampiran 5: List Program Keluaran Saat Tidak Ada Hasil
function varargout = TidakAdaHasil(varargin) % TIDAKADAHASIL MATLAB code for TidakAdaHasil.fig % TIDAKADAHASIL, by itself, creates a new TIDAKADAHASIL or
raises the existing % singleton*. % % H = TIDAKADAHASIL returns the handle to a new TIDAKADAHASIL
or the handle to % the existing singleton*. % % TIDAKADAHASIL('CALLBACK',hObject,eventData,handles,...)
calls the local % function named CALLBACK in TIDAKADAHASIL.M with the given
input arguments. % % TIDAKADAHASIL('Property','Value',...) creates a new TID-
AKADAHASIL or raises the % existing singleton*. Starting from the left, property val-
ue pairs are % applied to the GUI before TidakAdaHasil_OpeningFcn gets
called. An % unrecognized property name or invalid value makes property
application % stop. All inputs are passed to TidakAdaHasil_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 TidakAdaHasil
% Last Modified by GUIDE v2.5 08-May-2017 13:46:33
% Begin initialization code - DO NOT EDIT gui_Singleton = 1; gui_State = struct('gui_Name', mfilename, ... 'gui_Singleton', gui_Singleton, ... 'gui_OpeningFcn', @TidakAdaHasil_OpeningFcn,
... 'gui_OutputFcn', @TidakAdaHasil_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{:});
PLAGIAT MERUPAKAN TINDAKAN TIDAK TERPUJI
else gui_mainfcn(gui_State, varargin{:}); end % End initialization code - DO NOT EDIT
% --- Executes just before TidakAdaHasil is made visible. function TidakAdaHasil_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 TidakAdaHasil (see
VARARGIN)
% Choose default command line output for TidakAdaHasil handles.output = hObject;
% UIWAIT makes TidakAdaHasil wait for user response (see UIRESUME) % uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line. function varargout = TidakAdaHasil_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;
PLAGIAT MERUPAKAN TINDAKAN TIDAK TERPUJI
Lampiran 6: List Program Detail Pemotongan
function varargout = DetailGuiSkripsi(varargin) % DETAILGUISKRIPSI MATLAB code for DetailGuiSkripsi.fig % DETAILGUISKRIPSI, by itself, creates a new DETAILGUISKRIPSI
or raises the existing % singleton*. % % H = DETAILGUISKRIPSI returns the handle to a new DETAIL-
GUISKRIPSI or the handle to % the existing singleton*. % % DETAILGUISKRIPSI('CALLBACK',hObject,eventData,handles,...)
calls the local % function named CALLBACK in DETAILGUISKRIPSI.M with the giv-
en input arguments. % % DETAILGUISKRIPSI('Property','Value',...) creates a new DE-
TAILGUISKRIPSI or raises the % existing singleton*. Starting from the left, property val-
ue pairs are % applied to the GUI before DetailGuiSkripsi_OpeningFcn gets
called. An % unrecognized property name or invalid value makes property
application % stop. All inputs are passed to DetailGuiSkripsi_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 DetailGuiS-
kripsi
% Last Modified by GUIDE v2.5 19-Apr-2017 23:02:55
% Begin initialization code - DO NOT EDIT gui_Singleton = 1; gui_State = struct('gui_Name', mfilename, ... 'gui_Singleton', gui_Singleton, ... 'gui_OpeningFcn', @DetailGuiSkripsi_OpeningFcn,
... 'gui_OutputFcn', @DetailGuiSkripsi_OutputFcn,
... 'gui_LayoutFcn', [] , ... 'gui_Callback', []); if nargin && ischar(varargin{1}) gui_State.gui_Callback = str2func(varargin{1}); end
PLAGIAT MERUPAKAN TINDAKAN TIDAK TERPUJI
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 DetailGuiSkripsi is made visible. function DetailGuiSkripsi_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 DetailGuiSkripsi (see
VARARGIN)
% Choose default command line output for DetailGuiSkripsi handles.output = hObject;
% UIWAIT makes DetailGuiSkripsi wait for user response (see
UIRESUME) % uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line. function varargout = DetailGuiSkripsi_OutputFcn(hObject, event-
data, 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 RolK_Callback(hObject, eventdata, handles) % hObject handle to RolK (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 RolK as text % str2double(get(hObject,'String')) returns contents of
RolK as a double
PLAGIAT MERUPAKAN TINDAKAN TIDAK TERPUJI
% --- Executes during object creation, after setting all proper-
ties. function RolK_CreateFcn(hObject, eventdata, handles) % hObject handle to RolK (see GCBO) % eventdata reserved - to be defined in a future version of
MATLAB % handles empty - handles not created until after all Cre-
ateFcns called input=str2num(get(hObject,'String')); % 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 KertasP_Callback(hObject, eventdata, handles) % hObject handle to KertasP (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 KertasP as text % str2double(get(hObject,'String')) returns contents of
KertasP as a double
% --- Executes during object creation, after setting all proper-
ties. function KertasP_CreateFcn(hObject, eventdata, handles) % hObject handle to KertasP (see GCBO) % eventdata reserved - to be defined in a future version of
MATLAB % handles empty - handles not created until after all Cre-
ateFcns called input=str2num(get(hObject,'String')); % 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 popupmenu1. function popupmenu1_Callback(hObject, eventdata, handles) % hObject handle to popupmenu1 (see GCBO) % eventdata reserved - to be defined in a future version of
MATLAB % handles structure with handles and user data (see GUIDATA)
popupmenu1 contents as cell array % contents{get(hObject,'Value')} returns selected item from
popupmenu1 switch get (handles.popupmenu1,'Value') case 1
case 2 close; GUISkripsi clear all case 3 close; otherwise end
% --- Executes during object creation, after setting all proper-
ties. function popupmenu1_CreateFcn(hObject, eventdata, handles) % hObject handle to popupmenu1 (see GCBO) % eventdata reserved - to be defined in a future version of
MATLAB % handles empty - handles not created until after all Cre-
ateFcns called
% Hint: popupmenu controls usually have a white background on Win-
dows. % See ISPC and COMPUTER. if ispc && isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end
% --- Executes on button press in CekHasil1. function CekHasil1_Callback(hObject, eventdata, handles) % hObject handle to CekHasil1 (see GCBO) % eventdata reserved - to be defined in a future version of
MATLAB % handles structure with handles and user data (see GUIDATA) global xS k a j A1 %digunakan untuk menyimpan variabel secara
keseluruhan %untuk memisah nilai xS ke setiap variabel keputusan xYk=xS(1:k,1)'; xyjk=xS(k+1:k+j*k,1)'; xai=xS(k+j*k+1:k+j*k+a,1)'; xsp=xS(k+j*k+a+1:k+j*k+2*a,1)'; xsn=xS(k+j*k+2*a+1:k+j*k+3*a,1)'; xpjk=xS(k+j*k+3*a+1:k+2*j*k+3*a,1)'; xxijk=xS(k+2*j*k+3*a+1:k+2*j*k+3*a+j*k*a,1)'; %untuk mengambil nilai dari rol keertas RolKk=get(handles.RolK,'String'); Rol=str2num(RolKk); %untuk memasukannya ke kolom yang ditentukan
PLAGIAT MERUPAKAN TINDAKAN TIDAK TERPUJI
RolS=num2str(Rol); set(handles.RolK1,'String',RolS) set(handles.RolK2,'String',RolS) set(handles.RolK3,'String',RolS) %untuk memasukan nilai pada kaliamat ke 1 for c=1:k Xpjk(c,1:j)=xpjk(1,(c-1)*j+1:j*c); end PolaDG1=find(Xpjk(Rol,:)); PolaDGS1=num2str(PolaDG1); set(handles.PolaK1,'String',PolaDGS1) HSL1=Xpjk(Rol,PolaDG1); HSLS1=num2str(HSL1); set(handles.Hasil1,'String',HSLS1) %untuk memasukan nilai pada kaliamat ke 2 for c=1:k Xyjk(c,1:j)=xyjk(1,(c-1)*j+1:j*c); end PolaDG2=find(Xyjk(Rol,:)); PolaDGS2=num2str(PolaDG2); set(handles.PolaK2,'String',PolaDGS2) %untuk memasukan nilai pada kaliamat ke 3 set(handles.PolaK3,'String',PolaDGS2) %untuk memasukan nilai pada table PisauV=A1(PolaDG2,:); for c=1:k Xxijk1(c,1:j*a)=xxijk(1,(c-1)*j*a+1:j*c*a); end for z=1:j Xxijk(z,1:a)=Xxijk1(Rol,(z-1)*a+1:a*z); end PisauH=Xxijk(PolaDG2,:); TKertas=PisauV.*PisauH; MTKertas=[PisauV;PisauH;TKertas]; set(handles.TableH,'Data',MTKertas) %untuk memasukannya ke kolom yang ditentukan Kertas=get(handles.KertasP,'String'); KertasC=str2num(Kertas); KertasS=num2str(Kertas); %untuk memasukan nilai pada kaliamat ke 1 set(handles.ProdukK1,'String',KertasS); set(handles.ProdukK2,'String',KertasS); set(handles.ProdukK3,'String',KertasS); %untuk memasukan nilai pada kaliamat ke 4 HSL2=xai(KertasC); HSLS2=num2str(HSL2); set(handles.Hasil2,'String',HSLS2) %untuk memasukan nilai pada kaliamat ke 5 HSL3=xsp(KertasC); HSLS3=num2str(HSL3); set(handles.Hasil3,'String',HSLS3) %untuk memasukan nilai pada kaliamat ke 6 HSL4=xsn(KertasC); HSLS4=num2str(HSL4); set(handles.Hasil4,'String',HSLS4)
PLAGIAT MERUPAKAN TINDAKAN TIDAK TERPUJI
% --- Executes when entered data in editable cell(s) in TableH. function TableH_CellEditCallback(hObject, eventdata, handles) % hObject handle to TableH (see GCBO) % eventdata structure with the following fields (see
MATLAB.UI.CONTROL.TABLE) % Indices: row and column indices of the cell(s) edited % PreviousData: previous data for the cell(s) edited % EditData: string(s) entered by the user % NewData: EditData or its converted form set on the Data prop-
erty. Empty if Data was not changed % Error: error string when failed to convert EditData to appro-
priate value for Data % handles structure with handles and user data (see GUIDATA)