Sunteți pe pagina 1din 33

TUGAS

PENGOLAHAN CITRA
DIGITAL

Oleh :
Wakhid Rokhayadi
NIM. 15.01.63.0001

PROGRAM STUDI TEKNIK


INFORMATIKA
FAKULTAS TEKNOLOGI INFORMASI

UNIVERSITAS
STIKUBANK
SEMARANG 2015
PRAKTIKUM KONVERSI WARNA KE GRAY

LIST PROGRAM KONVERSI WARNA KE GRAY:


function varargout = GUI_01GRAY(varargin)
% GUI_01GRAY M-file for GUI_01GRAY.fig
% GUI_01GRAY, by itself, creates a new GUI_01GRAY or raises the
existing
% singleton*.
%
% H = GUI_01GRAY returns the handle to a new GUI_01GRAY or the
handle to
% the existing singleton*.
% GUI_01GRAY('CALLBACK',hObject,eventData,handles,...) calls the
local
% function named CALLBACK in GUI_01GRAY.M with the given input
arguments.
%
% GUI_01GRAY('Property','Value',...) creates a new GUI_01GRAY or
raises the
% existing singleton*. Starting from the left, property value
pairs are
% applied to the GUI before GUI_01GRAY_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property
application
% stop. All inputs are passed to GUI_01GRAY_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 GUI_01GRAY
% Last Modified by GUIDE v2.5 07-Dec-2015 09:44:00
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',
mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @GUI_01GRAY_OpeningFcn, ...
'gui_OutputFcn', @GUI_01GRAY_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
% End initialization code - DO NOT EDIT
% --- Executes just before GUI_01GRAY is made visible.
function GUI_01GRAY_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 GUI_01GRAY (see VARARGIN)
% Choose default command line output for GUI_01GRAY
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes GUI_01GRAY wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = GUI_01GRAY_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;
% --- Executes on button press in pushbutton1.
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject
handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of
MATLAB
% handles
structure with handles and user data (see GUIDATA)
[namafile, namadirektori] = uigetfile(...
{'*.bmp;*.jpg','File gambar(*.bmp,*.jpg)';...
'*.bmp','File Bitmap(*.bmp)';...
'*.jpg','File JPEG(*.jpg)';...
'*.*','Semua File(*.*)'},...
'Buka File Gambar Asli');
if ~isequal(namafile,0)
handles.dataGambar=imread(fullfile(namadirektori,namafile));
guidata(hObject,handles);
handles.dataGambar2=handles.dataGambar;
axes(handles.axes1);
imshow(handles.dataGambar2);
else
return;
end
% --- Executes on button press in pushbutton2.
function pushbutton2_Callback(hObject, eventdata, handles)
% hObject
handle to pushbutton2 (see GCBO)
% eventdata reserved - to be defined in a future version of
MATLAB
% handles
structure with handles and user data (see GUIDATA)

dataGambarProses=(handles.dataGambar);
dataGambarProsesGrey=rgb2gray(dataGambarProses);
axes(handles.axes2);
imshow(dataGambarProsesGrey);
% --- Executes on button press in pushbutton3.
function pushbutton3_Callback(hObject, eventdata, handles)
% hObject
handle to pushbutton3 (see GCBO)
% eventdata reserved - to be defined in a future version of
MATLAB
% handles
structure with handles and user data (see GUIDATA)
close();

PRAKTIKUM KONVERSI WARNA KE BLACK WHITE

LIST PROGRAM KONVERSI WARNA KE BLACK WHITE


function varargout = GUI_01BW(varargin)
% GUI_01BW M-file for GUI_01BW.fig
% GUI_01BW, by itself, creates a new GUI_01BW or raises the
existing
% singleton*.
%
% H = GUI_01BW returns the handle to a new GUI_01BW or the handle
to
% the existing singleton*.
% GUI_01BW('CALLBACK',hObject,eventData,handles,...) calls the
local
% function named CALLBACK in GUI_01BW.M with the given input
arguments.
%
% GUI_01BW('Property','Value',...) creates a new GUI_01BW or
raises the
% existing singleton*. Starting from the left, property value
pairs are
% applied to the GUI before GUI_01BW_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property
application
% stop. All inputs are passed to GUI_01BW_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 GUI_01BW
% Last Modified by GUIDE v2.5 07-Dec-2015 09:33:37
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',
mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @GUI_01BW_OpeningFcn, ...
'gui_OutputFcn', @GUI_01BW_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
% End initialization code - DO NOT EDIT
% --- Executes just before GUI_01BW is made visible.
function GUI_01BW_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 GUI_01BW (see VARARGIN)
% Choose default command line output for GUI_01BW
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes GUI_01BW wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = GUI_01BW_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;
% --- Executes on button press in pushbutton1.
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject
handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of
MATLAB
% handles
structure with handles and user data (see GUIDATA)
[namafile, namadirektori] = uigetfile(...
{'*.bmp;*.jpg','File gambar(*.bmp,*.jpg)';...
'*.bmp','File Bitmap(*.bmp)';...
'*.jpg','File JPEG(*.jpg)';...
'*.*','Semua File(*.*)'},...
'Buka File Gambar Asli');
if ~isequal(namafile,0)
handles.dataGambar=imread(fullfile(namadirektori,namafile));
guidata(hObject,handles);
handles.dataGambar2=handles.dataGambar;
axes(handles.axes1);
imshow(handles.dataGambar2);
else
return;
end
% --- Executes on button press in pushbutton2.
function pushbutton2_Callback(hObject, eventdata, handles)
% hObject
handle to pushbutton2 (see GCBO)
% eventdata reserved - to be defined in a future version of
MATLAB
% handles
structure with handles and user data (see GUIDATA)
dataGambarProses=(handles.dataGambar);

dataGambarProsesBW=im2bw(dataGambarProses);
axes(handles.axes2);
imshow(dataGambarProsesBW);
% --- Executes on button press in pushbutton3.
function pushbutton3_Callback(hObject, eventdata, handles)
% hObject
handle to pushbutton3 (see GCBO)
% eventdata reserved - to be defined in a future version of
MATLAB
% handles
structure with handles and user data (see GUIDATA)
close();

PRAKTIKUM ROTASI GAMBAR

LIST PROGRAM ROTASI GAMBAR :


function varargout = GUI_01Rotasi(varargin)
% GUI_01Rotasi M-file for GUI_01Rotasi.fig
% GUI_01Rotasi, by itself, creates a new GUI_01Rotasi or raises
the existing
% singleton*.
% H = GUI_01Rotasi returns the handle to a new GUI_01Rotasi or the
handle to
% the existing singleton*.
% GUI_01Rotasi('CALLBACK',hObject,eventData,handles,...) calls the
local
% function named CALLBACK in GUI_01Rotasi.M with the given input
arguments.
% GUI_01Rotasi('Property','Value',...) creates a new GUI_01Rotasi
or raises the
% existing singleton*. Starting from the left, property value
pairs are
% applied to the GUI before GUI_01Rotasi_OpeningFcn gets called.
An
% unrecognized property name or invalid value makes property
application
% stop. All inputs are passed to GUI_01Rotasi_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 GUI_01Rotasi
% Last Modified by GUIDE v2.5 07-Dec-2015 09:47:59
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',
mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @GUI_01Rotasi_OpeningFcn, ...
'gui_OutputFcn', @GUI_01Rotasi_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
% End initialization code - DO NOT EDIT

% --- Executes just before GUI_01Rotasi is made visible.


function GUI_01Rotasi_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 GUI_01Rotasi (see VARARGIN)
% Choose default command line output for GUI_01Rotasi
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes GUI_01Rotasi wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = GUI_01Rotasi_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;
% --- Executes on button press in pushbutton1.
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject
handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of
MATLAB
% handles
structure with handles and user data (see GUIDATA)
[namafile, namadirektori] = uigetfile(...
{'*.bmp;*.jpg','File gambar(*.bmp,*.jpg)';...
'*.bmp','File Bitmap(*.bmp)';...
'*.jpg','File JPEG(*.jpg)';...
'*.*','Semua File(*.*)'},...
'Buka File Gambar Asli');
if ~isequal(namafile,0)
handles.dataGambar=imread(fullfile(namadirektori,namafile));
guidata(hObject,handles);
handles.dataGambar2=handles.dataGambar;
axes(handles.axes1);
imshow(handles.dataGambar2);
else
return;
end
% --- Executes on button press in pushbutton2.
function pushbutton2_Callback(hObject, eventdata, handles)
% hObject
handle to pushbutton2 (see GCBO)
% eventdata reserved - to be defined in a future version of
MATLAB
% handles
structure with handles and user data (see GUIDATA)
dataGambarProses=(handles.dataGambar);
dataGambarProsesRotasi=imrotate(dataGambarProses, 45);

10

axes(handles.axes2);
imshow(dataGambarProsesRotasi);
% --- Executes on button press in pushbutton3.
function pushbutton3_Callback(hObject, eventdata, handles)
% hObject
handle to pushbutton3 (see GCBO)
% eventdata reserved - to be defined in a future version of
MATLAB
% handles
structure with handles and user data (see GUIDATA)
close();

PRAKTIKUM CROPING GAMBAR

11

LIST PROGRAM CROPING GAMBAR :


function varargout = GUI_01Croping(varargin)
% GUI_01Croping M-file for GUI_01Croping.fig
% GUI_01Croping, by itself, creates a new GUI_01Croping or raises
the existing
% singleton*.
% H = GUI_01Croping returns the handle to a new GUI_01Croping or
the handle to
% the existing singleton*.
% GUI_01Croping('CALLBACK',hObject,eventData,handles,...) calls
the local
% function named CALLBACK in GUI_01Croping.M with the given input
arguments.
%
% GUI_01Croping('Property','Value',...) creates a new
GUI_01Croping or raises the
% existing singleton*. Starting from the left, property value
pairs are
% applied to the GUI before GUI_01Croping_OpeningFcn gets called.
An
% unrecognized property name or invalid value makes property
application
% stop. All inputs are passed to GUI_01Croping_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 GUI_01Croping
% Last Modified by GUIDE v2.5 07-Dec-2015 09:48:41
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',
mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @GUI_01Croping_OpeningFcn,
...
'gui_OutputFcn', @GUI_01Croping_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{:});

12

end
% End initialization code - DO NOT EDIT
% --- Executes just before GUI_01Croping is made visible.
function GUI_01Croping_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 GUI_01Croping (see
VARARGIN)
% Choose default command line output for GUI_01Croping
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes GUI_01Croping wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = GUI_01Croping_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;
% --- Executes on button press in pushbutton1.
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject
handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of
MATLAB
% handles
structure with handles and user data (see GUIDATA)
[namafile, namadirektori] = uigetfile(...
{'*.bmp;*.jpg','File gambar(*.bmp,*.jpg)';...
'*.bmp','File Bitmap(*.bmp)';...
'*.jpg','File JPEG(*.jpg)';...
'*.*','Semua File(*.*)'},...
'Buka File Gambar Asli');
if ~isequal(namafile,0)
handles.dataGambar=imread(fullfile(namadirektori,namafile));
guidata(hObject,handles);
handles.dataGambar2=handles.dataGambar;
axes(handles.axes1);
imshow(handles.dataGambar2);
else
return;
end
% --- Executes on button press in pushbutton2.
function pushbutton2_Callback(hObject, eventdata, handles)
% hObject
handle to pushbutton2 (see GCBO)
% eventdata reserved - to be defined in a future version of
MATLAB
% handles
structure with handles and user data (see GUIDATA)
dataGambarProses=(handles.dataGambar);
dataGambarProsesCroping=imcrop(dataGambarProses, [10 10 300 300]);
axes(handles.axes2);

13

imshow(dataGambarProsesCroping);
% --- Executes on button press in pushbutton3.
function pushbutton3_Callback(hObject, eventdata, handles)
% hObject
handle to pushbutton3 (see GCBO)
% eventdata reserved - to be defined in a future version of
MATLAB
% handles
structure with handles and user data (see GUIDATA)
close();

PRAKTIKUM MATERI KULIAH 2A

14

LIST PROGRAM PRAKTIKUM MATERI KULIAH 2A :


function varargout = GUI_02A(varargin)
% GUI_02A M-file for GUI_02A.fig
% GUI_02A, by itself, creates a new GUI_02A or raises the existing
% singleton*.
% H = GUI_02A returns the handle to a new GUI_02A or the handle to
% the existing singleton*.
%
% GUI_02A('CALLBACK',hObject,eventData,handles,...) calls the
local
% function named CALLBACK in GUI_02A.M with the given input
arguments.
% GUI_02A('Property','Value',...) creates a new GUI_02A or raises
the
% existing singleton*. Starting from the left, property value
pairs are
% applied to the GUI before GUI_02A_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property
application
% stop. All inputs are passed to GUI_02A_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 GUI_02A
% Last Modified by GUIDE v2.5 25-Nov-2015 10:08:07
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',
mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @GUI_02A_OpeningFcn, ...
'gui_OutputFcn', @GUI_02A_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
% End initialization code - DO NOT EDIT
% --- Executes just before GUI_02A is made visible.
function GUI_02A_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject
handle to figure

15

% 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 GUI_02A (see VARARGIN)
% Choose default command line output for GUI_02A
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes GUI_02A wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = GUI_02A_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;
% --- Executes on button press in pushbutton1.
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject
handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of
MATLAB
% handles
structure with handles and user data (see GUIDATA)
[namafile, namadirektori] = uigetfile(...
{'*.bmp;*.jpg','File gambar(*.bmp,*.jpg)';...
'*.bmp','File Bitmap(*.bmp)';...
'*.jpg','File JPEG(*.jpg)';...
'*.*','Semua File(*.*)'},...
'Buka File Gambar Asli');
if ~isequal(namafile,0)
handles.dataGambar=imread(fullfile(namadirektori,namafile));
guidata(hObject,handles);
handles.dataGambar2=handles.dataGambar;
axes(handles.axes1);
imshow(handles.dataGambar2);
else
return;
end
% --- Executes on button press in pushbutton2.
function pushbutton2_Callback(hObject, eventdata, handles)
% hObject
handle to pushbutton2 (see GCBO)
% eventdata reserved - to be defined in a future version of
MATLAB
% handles
structure with handles and user data (see GUIDATA)
dataGambarProses=(handles.dataGambar);
dataGambarProsesGray=rgb2gray(dataGambarProses);
axes(handles.axes2);
imshow(dataGambarProsesGray);
% --- Executes on button press in pushbutton3.
function pushbutton3_Callback(hObject, eventdata, handles)
% hObject
handle to pushbutton3 (see GCBO)
% eventdata reserved - to be defined in a future version of
MATLAB
% handles
structure with handles and user data (see GUIDATA)
dataGambarProses=(handles.dataGambar);

16

dataGambarProsesBlackWhite=im2bw(dataGambarProses);
axes(handles.axes2);
imshow(dataGambarProsesBlackWhite);
% --- Executes on button press in pushbutton4.
function pushbutton4_Callback(hObject, eventdata, handles)
% hObject
handle to pushbutton4 (see GCBO)
% eventdata reserved - to be defined in a future version of
MATLAB
% handles
structure with handles and user data (see GUIDATA)
dataGambarProses=(handles.dataGambar);
dataGambarProsesCroping=imcrop(dataGambarProses, [10 10 300 300]);
axes(handles.axes2);
imshow(dataGambarProsesCroping);
% --- Executes on button press in pushbutton5.
function pushbutton5_Callback(hObject, eventdata, handles)
% hObject
handle to pushbutton5 (see GCBO)
% eventdata reserved - to be defined in a future version of
MATLAB
% handles
structure with handles and user data (see GUIDATA)
dataGambarProses=(handles.dataGambar);
dataGambarProsesRotasi=imrotate(dataGambarProses, 45);
axes(handles.axes2);
imshow(dataGambarProsesRotasi);
% --- Executes on button press in pushbutton6.
function pushbutton6_Callback(hObject, eventdata, handles)
% hObject
handle to pushbutton6 (see GCBO)
% eventdata reserved - to be defined in a future version of
MATLAB
% handles
structure with handles and user data (see GUIDATA)
close();

17

PRAKTIKUM MATERI KULIAH 2B

18

LIST PROGRAM PRAKTIKUM MATERI KULIAH 2B :


function varargout = GUI_02B(varargin)
% GUI_02B M-file for GUI_02B.fig
% GUI_02B, by itself, creates a new GUI_02B or raises the existing
% singleton*.
% H = GUI_02B returns the handle to a new GUI_02B or the handle to
% the existing singleton*.
% GUI_02B('CALLBACK',hObject,eventData,handles,...) calls the
local
% function named CALLBACK in GUI_02B.M with the given input
arguments.
% GUI_02B('Property','Value',...) creates a new GUI_02B or raises
the
% existing singleton*. Starting from the left, property value
pairs are
% applied to the GUI before GUI_02B_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property
application
% stop. All inputs are passed to GUI_02B_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 GUI_02B
% Last Modified by GUIDE v2.5 25-Nov-2015 11:56:46
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',
'gui_Singleton',
'gui_OpeningFcn',
'gui_OutputFcn',

mfilename, ...
gui_Singleton, ...
@GUI_02B_OpeningFcn, ...
@GUI_02B_OutputFcn, ...

19

'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
% End initialization code - DO NOT EDIT
% --- Executes just before GUI_02B is made visible.
function GUI_02B_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 GUI_02B (see VARARGIN)
% Choose default command line output for GUI_02B
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes GUI_02B wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = GUI_02B_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;
% --- Executes on button press in pushbutton1.
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject
handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of
MATLAB
% handles
structure with handles and user data (see GUIDATA)
[namafile, namadirektori] = uigetfile(...
{'*.bmp;*.jpg','File gambar(*.bmp,*.jpg)';...
'*.bmp','File Bitmap(*.bmp)';...
'*.jpg','File JPEG(*.jpg)';...
'*.*','Semua File(*.*)'},...
'Buka File Gambar Asli');
if ~isequal(namafile,0)
handles.dataGambar=imread(fullfile(namadirektori,namafile));
guidata(hObject,handles);
handles.dataGambar2=handles.dataGambar;
axes(handles.axes1);
imshow(handles.dataGambar2);
dataGambarProses=(handles.dataGambar);

20

dataGambarProsesGray=rgb2gray(dataGambarProses);
axes(handles.axes2);
imshow(dataGambarProsesGray);
dataGambarProses=(handles.dataGambar);
dataGambarProsesBlackWhite=im2bw(dataGambarProses);
axes(handles.axes3);
imshow(dataGambarProsesBlackWhite);
dataGambarProses=(handles.dataGambar);
dataGambarProsesCroping=imcrop(dataGambarProses, [10 10 300
300]);
axes(handles.axes4);
imshow(dataGambarProsesCroping);
dataGambarProses=(handles.dataGambar);
dataGambarProsesRotasi=imrotate(dataGambarProses, 45);
axes(handles.axes5);
imshow(dataGambarProsesRotasi);
else

return;

end
% --- Executes on button press in pushbutton2.
function pushbutton2_Callback(hObject, eventdata, handles)
% hObject
handle to pushbutton2 (see GCBO)
% eventdata reserved - to be defined in a future version of
MATLAB
% handles
structure with handles and user data (see GUIDATA)
close();

21

PRAKTIKUM MATERI KULIAH 3

22

LIST PROGRAM MATERI KULIAH 3 :


function varargout = MK_03(varargin)
% MK_03 M-file for MK_03.fig
% MK_03, by itself, creates a new MK_03 or raises the existing
% singleton*.
% H = MK_03 returns the handle to a new MK_03 or the handle to
% the existing singleton*.
% MK_03('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in MK_03.M with the given input
arguments.
% MK_03('Property','Value',...) creates a new MK_03 or raises the
% existing singleton*. Starting from the left, property value
pairs are
% applied to the GUI before MK_03_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property
application
% stop. All inputs are passed to MK_03_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 MK_03
% Last Modified by GUIDE v2.5 01-Dec-2015 07:23:30
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',
mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @MK_03_OpeningFcn, ...
'gui_OutputFcn', @MK_03_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
% End initialization code - DO NOT EDIT
% --- Executes just before MK_03 is made visible.
function MK_03_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 MK_03 (see VARARGIN)

23

% Choose default command line output for MK_03


handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes MK_03 wait for user response (see UIRESUME)
% uiwait(handles.figure1);

% --- Outputs from this function are returned to the command line.
function varargout = MK_03_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;
% --- Executes on button press in pushbutton1.
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject
handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of
MATLAB
% handles
structure with handles and user data (see GUIDATA)
[namafile, namadirektori] = uigetfile(...
{'*.bmp;*.jpg','File gambar(*.bmp,*.jpg)';...
'*.bmp','File Bitmap(*.bmp)';...
'*.jpg','File JPEG(*.jpg)';...
'*.*','Semua File(*.*)'},...
'Buka File Gambar Asli');
if ~isequal(namafile,0)
handles.dataGambar=imread(fullfile(namadirektori,namafile));
guidata(hObject,handles);
handles.dataGambar2=handles.dataGambar;
axes(handles.axes1);
imshow(handles.dataGambar2);
set(handles.edit1,'String',namafile);
set(handles.edit2,'String',size(handles.dataGambar,1));
set(handles.edit3,'String',size(handles.dataGambar,2));
else
return;
end
% --- Executes on button press in pushbutton2.
function pushbutton2_Callback(hObject, eventdata,
% hObject
handle to pushbutton2 (see GCBO)
% eventdata reserved - to be defined in a future
MATLAB
% handles
structure with handles and user data
dataGambarProses=(handles.dataGambar);
dataGambarProsesGray=rgb2gray(dataGambarProses);
axes(handles.axes2);
imshow(dataGambarProsesGray);
% --- Executes on button press in pushbutton3.
function pushbutton3_Callback(hObject, eventdata,
% hObject
handle to pushbutton3 (see GCBO)
% eventdata reserved - to be defined in a future
MATLAB
% handles
structure with handles and user data

handles)
version of
(see GUIDATA)

handles)
version of
(see GUIDATA)

24

dataGambarProses=(handles.dataGambar);
dataGambarProsesBlackWhite=im2bw(dataGambarProses);
axes(handles.axes2);
imshow(dataGambarProsesBlackWhite);
% --- Executes on button press in pushbutton4.
function pushbutton4_Callback(hObject, eventdata, handles)
% hObject
handle to pushbutton4 (see GCBO)
% eventdata reserved - to be defined in a future version of
MATLAB
% handles
structure with handles and user data (see GUIDATA)
dataGambarProses=(handles.dataGambar);
dataGambarProsesCroping=imcrop(dataGambarProses, [10 10 300 300]);
axes(handles.axes2);
imshow(dataGambarProsesCroping);
% --- Executes on button press in pushbutton5.
function pushbutton5_Callback(hObject, eventdata, handles)
% hObject
handle to pushbutton5 (see GCBO)
% eventdata reserved - to be defined in a future version of
MATLAB
% handles
structure with handles and user data (see GUIDATA)
dataGambarProses=(handles.dataGambar);
dataGambarProsesRotasi=imrotate(dataGambarProses, 45);
axes(handles.axes2);
imshow(dataGambarProsesRotasi);
% --- Executes on button press in pushbutton6.
function pushbutton6_Callback(hObject, eventdata, handles)
% hObject
handle to pushbutton6 (see GCBO)
% eventdata reserved - to be defined in a future version of
MATLAB
% handles
structure with handles and user data (see GUIDATA)
close();
function edit1_Callback(hObject, eventdata, handles)
% hObject
handle to edit1 (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 edit1 as text
% str2double(get(hObject,'String')) returns contents of edit1 as a
double
% --- Executes during object creation, after setting all
properties.
function edit1_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit1 (see GCBO)
% eventdata reserved - to be defined in a future version of
MATLAB
% handles
empty - handles not created until after all
CreateFcns called
% 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 edit2_Callback(hObject, eventdata, handles)
% hObject
handle to edit2 (see GCBO)

25

% 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 edit2 as text
% str2double(get(hObject,'String')) returns contents of edit2 as a
double
% --- Executes during object creation, after setting all
properties.
function edit2_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit2 (see GCBO)
% eventdata reserved - to be defined in a future version of
MATLAB
% handles
empty - handles not created until after all
CreateFcns called
% 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 edit3_Callback(hObject, eventdata, handles)
% hObject
handle to edit3 (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 edit3 as text
% str2double(get(hObject,'String')) returns contents of edit3 as a
double
% --- Executes during object creation, after setting all
properties.
function edit3_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit3 (see GCBO)
% eventdata reserved - to be defined in a future version of
MATLAB
% handles
empty - handles not created until after all
CreateFcns called
% 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

26

PRAKTIKUM MATERI KULIAH 4

27

LIST PROGRAM MATERI KULIAH 4 :


function varargout = MK_04(varargin)
% MK_04 M-file for MK_04.fig
% MK_04, by itself, creates a new MK_04 or raises the existing
% singleton*.
% H = MK_04 returns the handle to a new MK_04 or the handle to
% the existing singleton*.
% MK_04('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in MK_04.M with the given input
arguments.
% MK_04('Property','Value',...) creates a new MK_04 or raises the
% existing singleton*. Starting from the left, property value
pairs are
% applied to the GUI before MK_04_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property
application
% stop. All inputs are passed to MK_04_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 MK_04
% Last Modified by GUIDE v2.5 01-Dec-2015 09:11:57
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',
mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @MK_04_OpeningFcn, ...
'gui_OutputFcn', @MK_04_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
% End initialization code - DO NOT EDIT
% --- Executes just before MK_04 is made visible.
function MK_04_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)

28

% varargin
command line arguments to MK_04 (see VARARGIN)
% Choose default command line output for MK_04
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes MK_04 wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = MK_04_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;
% --- Executes on button press in pushbutton1.
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject
handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of
MATLAB
% handles
structure with handles and user data (see GUIDATA)
[namafile, namadirektori] = uigetfile(...
{'*.bmp;*.jpg','File gambar(*.bmp,*.jpg)';...
'*.bmp','File Bitmap(*.bmp)';...
'*.jpg','File JPEG(*.jpg)';...
'*.*','Semua File(*.*)'},...
'Buka File Gambar Asli');
if ~isequal(namafile,0)
handles.dataGambar=imread(fullfile(namadirektori,namafile));
guidata(hObject,handles);
handles.dataGambar2=handles.dataGambar;
sumI=sum(sum(handles.dataGambar));
s=size(handles.dataGambar);
axes(handles.axes1);
imshow(handles.dataGambar2);
set(handles.edit1,'String',namafile);
set(handles.edit2,'String',size(handles.dataGambar,1));
set(handles.edit3,'String',size(handles.dataGambar,2));
handles.red=handles.dataGambar(:,:,1);
handles.green=handles.dataGambar(:,:,2);
handles.blue=handles.dataGambar(:,:,3);
sumR = sum(sum(handles.red));
sumG = sum(sum(handles.green));
sumB = sum(sum(handles.blue));
n= (sumR+sumG+sumB);
ratarataR = 1/n*sumR*1.0e+005;
ratarataG = 1/n*sumG*1.0e+005;
ratarataB = 1/n*sumB*1.0e+005;
set(handles.edit4,'String',ratarataR);
set(handles.edit5,'String',ratarataG);

29

set(handles.edit6,'String',ratarataB);
else
end

return;

% --- Executes on button press in pushbutton2.


function pushbutton2_Callback(hObject, eventdata, handles)
% hObject
handle to pushbutton2 (see GCBO)
% eventdata reserved - to be defined in a future version of
MATLAB
% handles
structure with handles and user data (see GUIDATA)
close();
% --- Executes on button press in radiobutton1.
function radiobutton1_Callback(hObject, eventdata, handles)
% hObject
handle to radiobutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of
MATLAB
% handles
structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of radiobutton1
dataGambarProses=(handles.dataGambar);
dataGambarProsesGray=rgb2gray(dataGambarProses);
axes(handles.axes2);
imshow(dataGambarProsesGray);
% --- Executes on button press in radiobutton2.
function radiobutton2_Callback(hObject, eventdata, handles)
% hObject
handle to radiobutton2 (see GCBO)
% eventdata reserved - to be defined in a future version of
MATLAB
% handles
structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of radiobutton2
dataGambarProses=(handles.dataGambar);
dataGambarProsesBlackWhite=im2bw(dataGambarProses);
axes(handles.axes2);
imshow(dataGambarProsesBlackWhite);
% --- Executes on button press in radiobutton3.
function radiobutton3_Callback(hObject, eventdata, handles)
% hObject
handle to radiobutton3 (see GCBO)
% eventdata reserved - to be defined in a future version of
MATLAB
% handles
structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of radiobutton3
dataGambarProses=(handles.dataGambar);
dataGambarProsesCroping=imcrop(dataGambarProses, [10 10 300 300]);
axes(handles.axes2);
imshow(dataGambarProsesCroping);
% --- Executes on button press in radiobutton4.
function radiobutton4_Callback(hObject, eventdata, handles)
% hObject
handle to radiobutton4 (see GCBO)
% eventdata reserved - to be defined in a future version of
MATLAB
% handles
structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of radiobutton4

30

dataGambarProses=(handles.dataGambar);
dataGambarProsesRotasi=imrotate(dataGambarProses, 45);
axes(handles.axes2);
imshow(dataGambarProsesRotasi);

function edit1_Callback(hObject, eventdata, handles)


% hObject
handle to edit1 (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 edit1 as text
% str2double(get(hObject,'String')) returns contents of edit1 as a
double
% --- Executes during object creation, after setting all
properties.
function edit1_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit1 (see GCBO)
% eventdata reserved - to be defined in a future version of
MATLAB
% handles
empty - handles not created until after all
CreateFcns called
% 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 edit2_Callback(hObject, eventdata, handles)
% hObject
handle to edit2 (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 edit2 as text
%
str2double(get(hObject,'String')) returns contents of
edit2 as a double
% --- Executes during object creation, after setting all
properties.
function edit2_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit2 (see GCBO)
% eventdata reserved - to be defined in a future version of
MATLAB
% handles
empty - handles not created until after all
CreateFcns called
% 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 edit3_Callback(hObject, eventdata, handles)
% hObject
handle to edit3 (see GCBO)
% eventdata reserved - to be defined in a future version of
MATLAB
% handles
structure with handles and user data (see GUIDATA)

31

% Hints: get(hObject,'String') returns contents of edit3 as text


%
str2double(get(hObject,'String')) returns contents of
edit3 as a double
% --- Executes during object creation, after setting all
properties.
function edit3_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit3 (see GCBO)
% eventdata reserved - to be defined in a future version of
MATLAB
% handles
empty - handles not created until after all
CreateFcns called
% 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 edit4_Callback(hObject, eventdata, handles)
% hObject
handle to edit4 (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 edit4 as text
%
str2double(get(hObject,'String')) returns contents of
edit4 as a double
i=imread(dataGambar2);
% --- Executes during object creation, after setting all
properties.
function edit4_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit4 (see GCBO)
% eventdata reserved - to be defined in a future version of
MATLAB
% handles
empty - handles not created until after all
CreateFcns called
% 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 edit5_Callback(hObject, eventdata, handles)
% hObject
handle to edit5 (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 edit5 as text
%
str2double(get(hObject,'String')) returns contents of
edit5 as a double
% --- Executes during object creation, after setting all
properties.
function edit5_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit5 (see GCBO)
% eventdata reserved - to be defined in a future version of
MATLAB

32

% handles
empty - handles not created until after all
CreateFcns called
% 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 edit6_Callback(hObject, eventdata, handles)
% hObject
handle to edit6 (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 edit6 as text
%
str2double(get(hObject,'String')) returns contents of
edit6 as a double
% --- Executes during object creation, after setting all
properties.
function edit6_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit6 (see GCBO)
% eventdata reserved - to be defined in a future version of
MATLAB
% handles
empty - handles not created until after all
CreateFcns called
% 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

S-ar putea să vă placă și