function varargout = ketqua(varargin)
PHỤ LỤC function varargout = ketqua(varargin) gui_Singleton = 1; gui_State = struct('gui_Name', mfilename, 'gui_Singleton', gui_Singleton, 'gui_OpeningFcn', @ketqua_OpeningFcn, 'gui_OutputFcn', @ketqua_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{:}); else gui_mainfcn(gui_State, varargin{:}); end function ketqua_OpeningFcn(hObject, eventdata, handles, varargin) handles.output = hObject; guidata(hObject, handles); varargout{1} = handles.output; function NUT1_Callback(hObject, eventdata, handles) set(handles.NUT1,'Value',1); set(handles.NUT2,'Value',0); set(handles.NUT3,'Value',0); set(handles.NUT4,'Value',0); set(handles.NUT5,'Value',0); set(handles.NUT6,'Value',0); set(handles.NUT7,'Value',0); set(handles.NUT8,'Value',0); set(handles.NUT9,'Value',0); set(handles.NUT10,'Value',0); set(handles.NUT11,'Value',0); set(handles.NUT12,'Value',0); %THONG SO C = 6; L = 5; lamda = 1000; %KHI KHONG SU DUNG FDL B = 0; n0 = 10^3.*C./(lamda.*L); % DIEU KIEN n0+1i n=25; p=factorial(n)./(factorial(i).*factorial(n-i)).*((b./(a+b)).^i).*((b./(a+b)).^(n-i)); Pl=p.*exp(-i.*a.*Ti); %VE HAM Pl THEO i h=plot(i,Pl,'b*-'); title('ket qua khong su dung FDL'); xlabel('luu luong tai'); ylabel('xac suat chum suy hao'); %HIEN THI TREN HE TOA DO axes(h) function NUT2_Callback(hObject, eventdata, handles) set(handles.NUT1,'Value',0); set(handles.NUT2,'Value',1); set(handles.NUT3,'Value',0); set(handles.NUT4,'Value',0); set(handles.NUT5,'Value',0); set(handles.NUT6,'Value',0); set(handles.NUT7,'Value',0); set(handles.NUT8,'Value',0); set(handles.NUT9,'Value',0); set(handles.NUT10,'Value',0); set(handles.NUT11,'Value',0); set(handles.NUT12,'Value',0); %THONG SO C = 6; L = 1; lamda = 1000; %KHI SU DUNG FDL = 10 ms B1=10; n0 = 10^3.*C./(lamda.*L); %CHON i THOA DIEU KIEN i>n0+1 i=7:12; Ti1=B1.*C./(lamda.*L.*(i-n0).*(i-n0+1)); a=3.333; b=1.4286; %CHON n THOA DIEU KIEN n>i n=25; p=factorial(n)./(factorial(i).*factorial(n-i)).*((b./(a+b)).^i).*((b./(a+b)).^(n-i)); Pl1=p.*exp(-i.*a.*Ti1); %VE HAM Pl1 THEO i g=plot(i,Pl1,'ko '); title('ket qua FDL=10ms'); xlabel('luu luong tai'); ylabel('xac suat chum suy hao'); %HIEN THI TREN HE TOA DO axes(g) function NUT3_Callback(hObject, eventdata, handles) set(handles.NUT1,'Value',0); set(handles.NUT2,'Value',0); set(handles.NUT3,'Value',1); set(handles.NUT4,'Value',0); set(handles.NUT5,'Value',0); set(handles.NUT6,'Value',0); set(handles.NUT7,'Value',0); set(handles.NUT8,'Value',0); set(handles.NUT9,'Value',0); set(handles.NUT10,'Value',0); set(handles.NUT11,'Value',0); set(handles.NUT12,'Value',0); %THONG SO C = 6; L = 1; lamda = 1000; %KHI SU DUNG FDL = 50 ms B2=50; n0 = 10^3.*C./(lamda.*L); %CHON i THOA DIEU KIEN i>n0+1 i=7:12; Ti2=B2.*C./(lamda.*L.*(i-n0).*(i-n0+1)); a=3.333; b=1.4286; %CHON n THOA DIEU KIEN n>i n=25; p=factorial(n)./(factorial(i).*factorial(n-i)).*((b./(a+b)).^i).*((b./(a+b)).^(n-i)); Pl2=p.*exp(-i.*a.*Ti2); %VE HAM Pl2 THEO i m=plot(i,Pl2,'r+:'); title('ket qua FDL=50ms'); xlabel('luu luong tai'); ylabel('xac suat chum suy hao'); %HIEN THI TREN HE TOA DO axes(m,'square') % - Executes on button press in NUT4 function NUT4_Callback(hObject, eventdata, handles) set(handles.NUT1,'Value',0); set(handles.NUT2,'Value',0); set(handles.NUT3,'Value',0); set(handles.NUT4,'Value',1); set(handles.NUT5,'Value',0); set(handles.NUT6,'Value',0); set(handles.NUT7,'Value',0); set(handles.NUT8,'Value',0); set(handles.NUT9,'Value',0); set(handles.NUT10,'Value',0); set(handles.NUT11,'Value',0); set(handles.NUT12,'Value',0); %THONG SO C = 6; L = 1; lamda = 1000; %KET HOP KHONG SU DUNG FDL, KHI FDL=10ms VA FDL=50ms B = 0; B1=10; B2=50; n0 = 10^3.*C./(lamda.*L); i=7:12; Ti=B.*C./(lamda.*L.*(i-n0).*(i-n0+1)); Ti1=B1.*C./(lamda.*L.*(i-n0).*(i-n0+1)); Ti2=B2.*C./(lamda.*L.*(i-n0).*(i-n0+1)); a=3.333; b=1.4268; n=25; p=factorial(n)./(factorial(i).*factorial(n-i)).*((b./(a+b)).^i).*((b./(a+b)).^(n-i)); Pl=p.*exp(-i.*a.*Ti); Pl1=p.*exp(-i.*a.*Ti1); Pl2=p.*exp(-i.*a.*Ti2); %VE TONG HOP DO THI w=plot(i,Pl,'b*-',i,Pl1,'ko ',i,Pl2,'r+:'); title('so sanh ket qua'); xlabel('luu luong tai'); ylabel('xac suat chum suy hao'); %HIEN THI DO THI TONG HOP TREN HE TOA DO axes(w); function NUT5_Callback(hObject, eventdata, handles) set(handles.NUT1,'Value',0); set(handles.NUT2,'Value',0); set(handles.NUT3,'Value',0); set(handles.NUT4,'Value',0); set(handles.NUT5,'Value',1); set(handles.NUT6,'Value',0); set(handles.NUT7,'Value',0); set(handles.NUT8,'Value',0); set(handles.NUT9,'Value',0); set(handles.NUT10,'Value',0); set(handles.NUT11,'Value',0); set(handles.NUT12,'Value',0); %THONG SO C = 6; L = 1; lamda = 1000; %KHI SU DUNG FDL = 50 ms B5=0; n0 = 10^3.*C./(lamda.*L); %CHON i THOA DIEU KIEN i>n0+1 i=7:12; Ti5=B5.*C./(lamda.*L.*(i-n0).*(i-n0+1)); a5=3.1250; b5=1.4706; %CHON n THOA DIEU KIEN n>i n=25; p=factorial(n)./(factorial(i).*factorial(n-i)).*((b5./(a5+b5)).^i).*((b5./(a5+b5)).^(n-i)); Pl5=p.*exp(-i.*a5.*Ti5); %VE HAM Pl2 THEO i l=plot(i,Pl5,'k*:'); title('khong FDL voi 1/a=320 va 1/b=680'); xlabel('luu luong tai'); ylabel('xac suat chum suy hao'); %HIEN THI TREN HE TOA DO axes(l,'square') function NUT6_Callback(hObject, eventdata, handles) set(handles.NUT1,'Value',0); set(handles.NUT2,'Value',0); set(handles.NUT3,'Value',0); set(handles.NUT4,'Value',0); set(handles.NUT5,'Value',0); set(handles.NUT6,'Value',1); set(handles.NUT7,'Value',0); set(handles.NUT8,'Value',0); set(handles.NUT9,'Value',0); set(handles.NUT10,'Value',0); set(handles.NUT11,'Value',0); set(handles.NUT12,'Value',0); %THONG SO C = 6; L = 1; lamda = 1000; %KHI SU DUNG FDL = 50 ms B6=0; n0 = 10^3.*C./(lamda.*L); %CHON i THOA DIEU KIEN i>n0+1 i=7:12; Ti6=B6.*C./(lamda.*L.*(i-n0).*(i-n0+1)); a=3.333; b=1.4268; %CHON n THOA DIEU KIEN n>i n=25; p=factorial(n)./(factorial(i).*factorial(n-i)).*((b./(a+b)).^i).*((b./(a+b)).^(n-i)); Pl6=p.*exp(-i.*a.*Ti6); %VE HAM Pl2 THEO i q=plot(i,Pl6,'r+:'); title('khong FDL voi 1/a=300 va 1/b=700'); xlabel('luu luong tai'); ylabel('xac suat chum suy hao'); %HIEN THI TREN HE TOA DO axes(q,'square') function NUT7_Callback(hObject, eventdata, handles) set(handles.NUT1,'Value',0); set(handles.NUT2,'Value',0); set(handles.NUT3,'Value',0); set(handles.NUT4,'Value',0); set(handles.NUT5,'Value',0); set(handles.NUT6,'Value',0); set(handles.NUT7,'Value',1); set(handles.NUT8,'Value',0); set(handles.NUT9,'Value',0); set(handles.NUT10,'Value',0); set(handles.NUT11,'Value',0); set(handles.NUT12,'Value',0); %THONG SO C = 6; L = 1; lamda = 1000; %KHI SU DUNG FDL = 50 ms B7=0; n0 = 10^3.*C./(lamda.*L); %CHON i THOA DIEU KIEN i>n0+1 i=7:12; Ti7=B7.*C./(lamda.*L.*(i-n0).*(i-n0+1)); a7=3.5714; b7=1.3889; %CHON n THOA DIEU KIEN n>i n=25; p=factorial(n)./(factorial(i).*factorial(n-i)).*((b7./(a7+b7)).^i).*((b7./(a7+b7)).^(n-i)); Pl7=p.*exp(-i.*a7.*Ti7); %VE HAM Pl2 THEO i x=plot(i,Pl7,'bo:'); title('khong FDL voi 1/a=280 va 1/b=720'); xlabel('luu luong tai'); ylabel('xac suat chum suy hao'); %HIEN THI TREN HE TOA DO axes(x,'square') function NUT8_Callback(hObject, eventdata, handles) set(handles.NUT1,'Value',0); set(handles.NUT2,'Value',0); set(handles.NUT3,'Value',0); set(handles.NUT4,'Value',0); set(handles.NUT5,'Value',0); set(handles.NUT6,'Value',0); set(handles.NUT7,'Value',0); set(handles.NUT8,'Value',1); set(handles.NUT9,'Value',0); set(handles.NUT10,'Value',0); set(handles.NUT11,'Value',0); set(handles.NUT12,'Value',0); %THONG SO C = 6; L = 1; lamda = 1000; %KHI SU DUNG FDL = 50 ms B5=50; n0 = 10^3.*C./(lamda.*L); %CHON i THOA DIEU KIEN i>n0+1 i=7:12; Ti5=B5.*C./(lamda.*L.*(i-n0).*(i-n0+1)); a5=3.1250; b5=1.4706; %CHON n THOA DIEU KIEN n>i n=25; p=factorial(n)./(factorial(i).*factorial(n-i)).*((b5./(a5+b5)).^i).*((b5./(a5+b5)).^(n-i)); Pl5=p.*exp(-i.*a5.*Ti5); %VE HAM Pl2 THEO i l=plot(i,Pl5,'k*:'); title('khong FDL voi 1/a=320 va 1/b=680'); xlabel('luu luong tai'); ylabel('xac suat chum suy hao'); %HIEN THI TREN HE TOA DO axes(l,'square') function NUT9_Callback(hObject, eventdata, handles) set(handles.NUT1,'Value',0); set(handles.NUT2,'Value',0); set(handles.NUT3,'Value',0); set(handles.NUT4,'Value',0); set(handles.NUT5,'Value',0); set(handles.NUT6,'Value',0); set(handles.NUT7,'Value',0); set(handles.NUT8,'Value',0); set(handles.NUT9,'Value',1); set(handles.NUT10,'Value',0); set(handles.NUT11,'Value',0); set(handles.NUT12,'Value',0); %THONG SO C = 6; L = 1; lamda = 1000; %KHI SU DUNG FDL = 50 ms B6=50; n0 = 10^3.*C./(lamda.*L); %CHON i THOA DIEU KIEN i>n0+1 i=7:12; Ti6=B6.*C./(lamda.*L.*(i-n0).*(i-n0+1)); a=3.333; b=1.4268; %CHON n THOA DIEU KIEN n>i n=25; p=factorial(n)./(factorial(i).*factorial(n-i)).*((b./(a+b)).^i).*((b./(a+b)).^(n-i)); Pl6=p.*exp(-i.*a.*Ti6); %VE HAM Pl2 THEO i q=plot(i,Pl6,'r+:'); title('khong FDL voi 1/a=300 va 1/b=700'); xlabel('luu luong tai'); ylabel('xac suat chum suy hao'); %HIEN THI TREN HE TOA DO axes(q,'square') function NUT10_Callback(hObject, eventdata, handles) set(handles.NUT1,'Value',0); set(handles.NUT2,'Value',0); set(handles.NUT3,'Value',0); set(handles.NUT4,'Value',0); set(handles.NUT5,'Value',0); set(handles.NUT6,'Value',0); set(handles.NUT7,'Value',0); set(handles.NUT8,'Value',0); set(handles.NUT9,'Value',0); set(handles.NUT10,'Value',1); set(handles.NUT11,'Value',0); set(handles.NUT12,'Value',0); %THONG SO C = 6; L = 1; lamda = 1000; %KHI SU DUNG FDL = 50 ms B7=50; n0 = 10^3.*C./(lamda.*L); %CHON i THOA DIEU KIEN i>n0+1 i=7:12; Ti7=B7.*C./(lamda.*L.*(i-n0).*(i-n0+1)); a7=3.5714; b7=1.3889; %CHON n THOA DIEU KIEN n>i n=25; p=factorial(n)./(factorial(i).*factorial(n-i)).*((b7./(a7+b7)).^i).*((b7./(a7+b7)).^(n-i)); Pl7=p.*exp(-i.*a7.*Ti7); %VE HAM Pl2 THEO i x=plot(i,Pl7,'bo:'); title('khong FDL voi 1/a=280 va 1/b=720'); xlabel('luu luong tai'); ylabel('xac suat chum suy hao'); %HIEN THI TREN HE TOA DO axes(x,'square') function NUT11_Callback(hObject, eventdata, handles) set(handles.NUT1,'Value',0); set(handles.NUT2,'Value',0); set(handles.NUT3,'Value',0); set(handles.NUT4,'Value',0); set(handles.NUT5,'Value',0); set(handles.NUT6,'Value',0); set(handles.NUT7,'Value',0); set(handles.NUT8,'Value',0); set(handles.NUT9,'Value',0); set(handles.NUT10,'Value',0); set(handles.NUT11,'Value',1); set(handles.NUT12,'Value',0); C = 6; L = 1; lamda = 1000; %KHI SU DUNG FDL = 50 ms B6=0; n0 = 10^3.*C./(lamda.*L); %CHON i THOA DIEU KIEN i>n0+1 i=7:12; Ti6=B6.*C./(lamda.*L.*(i-n0).*(i-n0+1)); a5=3.1250; b5=1.4706; a=3.333; b=1.4268; a7=3.5714; b7=1.3889; %CHON n THOA DIEU KIEN n>i n=25; p=factorial(n)./(factorial(i).*factorial(n-i)).*((b./(a+b)).^i).*((b./(a+b)).^(n-i)); p5=factorial(n)./(factorial(i).*factorial(n-i)).*((b5./(a5+b5)).^i).*((b5./(a5+b5)).^(ni)); p7=factorial(n)./(factorial(i).*factorial(n-i)).*((b7./(a7+b7)).^i).*((b7./(a7+b7)).^(ni)); Pl6=p.*exp(-i.*a.*Ti6); Pl5=p5.*exp(-i.*a5.*Ti6); Pl7=p7.*exp(-i.*a7.*Ti6); %VE HAM Pl2 THEO i q=plot(i,Pl6,'r+:',i,Pl5,'k*:',i,Pl7,'bo:'); title('so sanh ket qua'); xlabel('luu luong tai'); ylabel('xac suat chum suy hao'); %HIEN THI TREN HE TOA DO axes(q,'square') function NUT12_Callback(hObject, eventdata, handles) set(handles.NUT1,'Value',0); set(handles.NUT2,'Value',0); set(handles.NUT3,'Value',0); set(handles.NUT4,'Value',0); set(handles.NUT5,'Value',0); set(handles.NUT6,'Value',0); set(handles.NUT7,'Value',0); set(handles.NUT8,'Value',0); set(handles.NUT9,'Value',0); set(handles.NUT10,'Value',0); set(handles.NUT11,'Value',0); set(handles.NUT12,'Value',1); C = 6; L = 1; lamda = 1000; %KHI SU DUNG FDL = 50 ms B6=50; n0 = 10^3.*C./(lamda.*L); %CHON i THOA DIEU KIEN i>n0+1 i=7:12; Ti6=B6.*C./(lamda.*L.*(i-n0).*(i-n0+1)); a5=3.1250; b5=1.4706; a=3.333; b=1.4268; a7=3.5714; b7=1.3889; %CHON n THOA DIEU KIEN n>i n=25; p=factorial(n)./(factorial(i).*factorial(n-i)).*((b./(a+b)).^i).*((b./(a+b)).^(n-i)); p5=factorial(n)./(factorial(i).*factorial(n-i)).*((b5./(a5+b5)).^i).*((b5./(a5+b5)).^(ni)); p7=factorial(n)./(factorial(i).*factorial(n-i)).*((b7./(a7+b7)).^i).*((b7./(a7+b7)).^(ni)); Pl6=p.*exp(-i.*a.*Ti6); Pl5=p5.*exp(-i.*a5.*Ti6); Pl7=p7.*exp(-i.*a7.*Ti6); %VE HAM Pl2 THEO i q=plot(i,Pl6,'r+:',i,Pl5,'k*:',i,Pl7,'bo:'); title('so sanh ket qua'); xlabel('luu luong tai'); ylabel('xac suat chum suy hao'); %HIEN THI TREN HE TOA DO axes(q,'square') ... FDL''); xlabel(''luu luong tai''); ylabel(''xac suat chum suy hao''); %HIEN THI TREN HE TOA DO axes(h) function NUT2_Callback(hObject, eventdata, handles) set(handles.NUT1,''Value'',0); set(handles.NUT2,''Value'',1);... FDL=10ms''); xlabel(''luu luong tai''); ylabel(''xac suat chum suy hao''); %HIEN THI TREN HE TOA DO axes(g) function NUT3_Callback(hObject, eventdata, handles) set(handles.NUT1,''Value'',0); set(handles.NUT2,''Value'',0);... chum suy hao''); %HIEN THI TREN HE TOA DO axes(m,''square'') % - Executes on button press in NUT4 function NUT4_Callback(hObject, eventdata, handles) set(handles.NUT1,''Value'',0); set(handles.NUT2,''Value'',0);