You are on page 1of 14

Screen Shoot 1

PERANCANGAN SISTEM BERBASIS KOMPUTER

Aris sutiana - 2010


M-file
function varargout = tugasuts(varargin)
% TUGASUTS M-file for tugasuts.fig
% TUGASUTS, by itself, creates a new TUGASUTS or raises the existing
% singleton*.
%
% H = TUGASUTS returns the handle to a new TUGASUTS or the handle to
% the existing singleton*.
%
% TUGASUTS('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in TUGASUTS.M with the given input arguments.
%
% TUGASUTS('Property','Value',...) creates a new TUGASUTS or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before tugasuts_OpeningFunction gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to tugasuts_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 tugasuts
% Last Modified by GUIDE v2.5 08-Nov-2010 19:55:39

% Begin initialization code - DO NOT EDIT


gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @tugasuts_OpeningFcn, ...
'gui_OutputFcn', @tugasuts_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

Aris sutiana - 2010


% End initialization code - DO NOT EDIT
% --- Executes just before tugasuts is made visible.
function tugasuts_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 tugasuts (see VARARGIN)

% Choose default command line output for tugasuts


handles.output = hObject;

% Update handles structure


guidata(hObject, handles);

% UIWAIT makes tugasuts wait for user response (see UIRESUME)


% uiwait(handles.figure1);

% --- Outputs from this function are returned to the command line.
function varargout = tugasuts_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;

function r1_Callback(hObject, eventdata, handles)


% hObject handle to r1 (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 r1 as text


% str2double(get(hObject,'String')) returns contents of r1 as a double

% --- Executes during object creation, after setting all properties.


function r1_CreateFcn(hObject, eventdata, handles)
% hObject handle to r1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB

Aris sutiana - 2010


% 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 r2_Callback(hObject, eventdata, handles)


% hObject handle to r2 (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 r2 as text


% str2double(get(hObject,'String')) returns contents of r2 as a double

% --- Executes during object creation, after setting all properties.


function r2_CreateFcn(hObject, eventdata, handles)
% hObject handle to r2 (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 r3_Callback(hObject, eventdata, handles)


% hObject handle to r3 (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 r3 as text


% str2double(get(hObject,'String')) returns contents of r3 as a double

% --- Executes during object creation, after setting all properties.


function r3_CreateFcn(hObject, eventdata, handles)

Aris sutiana - 2010


% hObject handle to r3 (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 r4_Callback(hObject, eventdata, handles)


% hObject handle to r4 (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 r4 as text


% str2double(get(hObject,'String')) returns contents of r4 as a double

% --- Executes during object creation, after setting all properties.


function r4_CreateFcn(hObject, eventdata, handles)
% hObject handle to r4 (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

% --- Executes on button press in pushbutton1.


function pushbutton1_Callback(hObject, eventdata, handles)
myform = guidata(gcbo);
rs1=str2double(get(myform.r1,'string'));
rs2=str2double(get(myform.r2,'string'));
rs3=str2double(get(myform.r3,'string'));
rs4=str2double(get(myform.r4,'string'));

rtot=(rs1+rs2+rs3+rs4);
set(myform.rtotal,'string',num2str(rtot));

Aris sutiana - 2010


% 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)

function rtotal_Callback(hObject, eventdata, handles)


% hObject handle to rtotal (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 rtotal as text


% str2double(get(hObject,'String')) returns contents of rtotal as a double

% --- Executes during object creation, after setting all properties.


function rtotal_CreateFcn(hObject, eventdata, handles)
% hObject handle to rtotal (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 rp1_Callback(hObject, eventdata, handles)


% hObject handle to rp1 (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 rp1 as text


% str2double(get(hObject,'String')) returns contents of rp1 as a double

% --- Executes during object creation, after setting all properties.


function rp1_CreateFcn(hObject, eventdata, handles)
% hObject handle to rp1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called

Aris sutiana - 2010


% 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 rp2_Callback(hObject, eventdata, handles)


% hObject handle to rp2 (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 rp2 as text


% str2double(get(hObject,'String')) returns contents of rp2 as a double

% --- Executes during object creation, after setting all properties.


function rp2_CreateFcn(hObject, eventdata, handles)
% hObject handle to rp2 (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 rp3_Callback(hObject, eventdata, handles)


% hObject handle to rp3 (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 rp3 as text


% str2double(get(hObject,'String')) returns contents of rp3 as a double

% --- Executes during object creation, after setting all properties.


function rp3_CreateFcn(hObject, eventdata, handles)
% hObject handle to rp3 (see GCBO)

Aris sutiana - 2010


% 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 rp4_Callback(hObject, eventdata, handles)


% hObject handle to rp4 (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 rp4 as text


% str2double(get(hObject,'String')) returns contents of rp4 as a double

% --- Executes during object creation, after setting all properties.


function rp4_CreateFcn(hObject, eventdata, handles)
% hObject handle to rp4 (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

% --- Executes on button press in pushbutton5.


function pushbutton5_Callback(hObject, eventdata, handles)
myform = guidata(gcbo);
rp1=str2double(get(myform.rp1,'string'));
rp2=str2double(get(myform.rp2,'string'));
rp3=str2double(get(myform.rp3,'string'));
rp4=str2double(get(myform.rp4,'string'));

rptot=1/(1/rp1)+(1/rp2)+(1/rp3)+(1/rp4);

set(myform.rpt,'string',num2str(rptot));

Aris sutiana - 2010


% 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)

function rpt_Callback(hObject, eventdata, handles)


% hObject handle to rpt (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 rpt as text


% str2double(get(hObject,'String')) returns contents of rpt as a double

% --- Executes during object creation, after setting all properties.


function rpt_CreateFcn(hObject, eventdata, handles)
% hObject handle to rpt (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

% --- Executes on button press in pushbutton6.


function pushbutton6_Callback(hObject, eventdata, handles)
myform=guidata(gcbo);
rtot=str2double(get(myform.rtotal,'string'));
itot=str2double(get(myform.iseri,'string'));

vtot=itot*rtot;
set(myform.vseri,'string',num2str(vtot));
% 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)

% --- Executes on button press in pushbutton7.

Aris sutiana - 2010


function pushbutton7_Callback(hObject, eventdata, handles)
myform=guidata(gcbo);
rtot=str2double(get(myform.rtotal,'string'));
vtot=str2double(get(myform.vseri,'string'));

itot=vtot/rtot;
set(myform.iseri,'string',num2str(itot));

% hObject handle to pushbutton7 (see GCBO)


% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

function vseri_Callback(hObject, eventdata, handles)


% hObject handle to vseri (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 vseri as text


% str2double(get(hObject,'String')) returns contents of vseri as a double

% --- Executes during object creation, after setting all properties.


function vseri_CreateFcn(hObject, eventdata, handles)
% hObject handle to vseri (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 iseri_Callback(hObject, eventdata, handles)


% hObject handle to iseri (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 iseri as text


% str2double(get(hObject,'String')) returns contents of iseri as a double

Aris sutiana - 2010


% --- Executes during object creation, after setting all properties.
function iseri_CreateFcn(hObject, eventdata, handles)
% hObject handle to iseri (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

% --- Executes on button press in pushbutton12.


function pushbutton12_Callback(hObject, eventdata, handles)
myform=guidata(gcbo);
rptot=str2double(get(myform.rpt,'string'));
itot=str2double(get(myform.iparalel,'string'));

vtot=itot*rptot;
set(myform.vparalel,'string',num2str(vtot));
% hObject handle to pushbutton12 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

% --- Executes on button press in pushbutton13.


function pushbutton13_Callback(hObject, eventdata, handles)
myform=guidata(gcbo);
rptot=str2double(get(myform.rpt,'string'));
vptot=str2double(get(myform.vparalel,'string'));

iptot=vptot/rptot;
set(myform.iparalel,'string',num2str(iptot));
% hObject handle to pushbutton13 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

function vparalel_Callback(hObject, eventdata, handles)


% hObject handle to vparalel (see GCBO)

Aris sutiana - 2010


% 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 vparalel as text


% str2double(get(hObject,'String')) returns contents of vparalel as a double

% --- Executes during object creation, after setting all properties.


function vparalel_CreateFcn(hObject, eventdata, handles)
% hObject handle to vparalel (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 iparalel_Callback(hObject, eventdata, handles)


% hObject handle to iparalel (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 iparalel as text


% str2double(get(hObject,'String')) returns contents of iparalel as a double

% --- Executes during object creation, after setting all properties.


function iparalel_CreateFcn(hObject, eventdata, handles)
% hObject handle to iparalel (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

Aris sutiana - 2010


% --- Executes during object creation, after setting all properties.
function axes2_CreateFcn(hObject, eventdata, handles)
x=str2num(get(iseri,'string'));
y=str2num(get(vseri,'string'));
plot(x,y);
% hObject handle to axes2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called

% Hint: place code in OpeningFcn to populate axes2

% --- Executes on button press in pushbutton15.


function pushbutton15_Callback(hObject, eventdata, handles)
myform=guidata(gcbo);
x=str2num(get(iseri,'string'));
y=str2num(get(vseri,'string'));
plot(x,y);
% hObject handle to pushbutton15 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

% --- Executes on button press in pushbutton16.


function pushbutton16_Callback(hObject, eventdata, handles)
myform=guidata(gcbo);
x=str2num(get(myform.vseri,'string'));
y=str2num(get(myform.iseri,'string'));
set(myform.figure1,'CurrentAxes',myform.grafik1b);
a=bar(x,y);
set(a,'linewidth',2);

% hObject handle to pushbutton16 (see GCBO)


% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

Aris sutiana - 2010


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

% --- Executes on button press in pushbutton18.


function pushbutton18_Callback(hObject, eventdata, handles)
close;
% hObject handle to pushbutton18 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

Aris sutiana - 2010

You might also like