0% found this document useful (0 votes)
44 views31 pages

Rumus Matlab 3

This document contains the code for a MATLAB graphical user interface (GUI) called PANELDENGANRUMUS. It includes initialization code to create the GUI, as well as callback functions to handle events like button presses or menu selections. The GUI allows the user to calculate geometric properties of various shapes by entering dimensions in edit boxes and clicking a button, with the results then displayed in other edit boxes.

Uploaded by

Masrizal Srg
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views31 pages

Rumus Matlab 3

This document contains the code for a MATLAB graphical user interface (GUI) called PANELDENGANRUMUS. It includes initialization code to create the GUI, as well as callback functions to handle events like button presses or menu selections. The GUI allows the user to calculate geometric properties of various shapes by entering dimensions in edit boxes and clicking a button, with the results then displayed in other edit boxes.

Uploaded by

Masrizal Srg
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 31

function varargout = PANELDENGANRUMUS(varargin)

% PANELDENGANRUMUS MATLAB code for PANELDENGANRUMUS.fig


% PANELDENGANRUMUS, by itself, creates a new PANELDENGANRUMUS or raises
the existing
% singleton*.
%
% H = PANELDENGANRUMUS returns the handle to a new PANELDENGANRUMUS or
the handle to
% the existing singleton*.
%
% PANELDENGANRUMUS('CALLBACK',hObject,eventData,handles,...) calls the
local
% function named CALLBACK in PANELDENGANRUMUS.M with the given input
arguments.
%
% PANELDENGANRUMUS('Property','Value',...) creates a new
PANELDENGANRUMUS or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before PANELDENGANRUMUS_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to PANELDENGANRUMUS_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 PANELDENGANRUMUS

% Last Modified by GUIDE v2.5 30-May-2016 15:03:58

% Begin initialization code - DO NOT EDIT


gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @PANELDENGANRUMUS_OpeningFcn, ...
'gui_OutputFcn', @PANELDENGANRUMUS_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 PANELDENGANRUMUS is made visible.


function PANELDENGANRUMUS_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 PANELDENGANRUMUS (see VARARGIN)

% Choose default command line output for PANELDENGANRUMUS


handles.output = hObject;

% Update handles structure


guidata(hObject, handles);

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


% uiwait(handles.figure1);

% --- Outputs from this function are returned to the command line.
function varargout = PANELDENGANRUMUS_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 Untitled_1_Callback(hObject, eventdata, handles)
% hObject handle to Untitled_1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

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

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

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

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

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

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

% --------------------------------------------------------------------
function menunew_Callback(hObject, eventdata, handles)
% hObject handle to menunew (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
fh = figure ( );

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

% --------------------------------------------------------------------
function tugas1_Callback(hObject, eventdata, handles)
% hObject handle to tugas1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
run('F:\University Of Riau\SEMESTER 2\Fisdas\Matlab Tugas
3\PENGERJAAN\MICHAELMATLAB1.m');

% --------------------------------------------------------------------
function Untitled_11_Callback(hObject, eventdata, handles)
% hObject handle to Untitled_11 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
run('F:\University Of Riau\SEMESTER 2\Fisdas\Matlab Tugas
3\PENGERJAAN\MICHAELMATLAB2.m');

% --- 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)
pbalok=str2double(get(handles.edit1,'String'));
lbalok=str2double(get(handles.edit3,'String'));
tbalok=str2double(get(handles.edit2,'String'));
rkubus=str2double(get(handles.edit4,'String'));
jbola=str2double(get(handles.edit5,'String'));
ttabung=str2double(get(handles.edit6,'String'));
rtabung=str2double(get(handles.edit8,'String'));
rkerucut=str2double(get(handles.edit9,'String'));
skerucut=str2double(get(handles.edit11,'String'));
tkerucut=str2double(get(handles.edit10,'String'));

luaspermukaankubus=6*(rkubus.*rkubus);
panjangrusukkubus=12*rkubus;
diagonalbidangkubus=rkubus*(sqrt(2));
diagonalruangkubus=rkubus*(sqrt(3));
volumekubus=rkubus.^3;

luaspermukaanbalok=2*((pbalok.*lbalok)+(pbalok.*tbalok)+(lbalok.*tbalok));
panjangrusukbalok=4*(pbalok+lbalok+tbalok);
diagonalruangbalok=sqrt((pbalok.^2)+(lbalok.^2)+(tbalok.^2));
volumebalok=pbalok.*lbalok.*tbalok;

luaspermukaanbola=4.*22/7.*jbola.*jbola;
volumebola=4/3.*22/7.*jbola.*jbola.*jbola;

luaspermukaantabung=2.*22/7.*rtabung.*(ttabung+rtabung);
luasselimuttabung=2.*22/7.*rtabung.*ttabung;
luaspermukaantanpatabung=(22/7*rtabung.*rtabung)+(luasselimuttabung);
volumetabung=22/7*rtabung.*rtabung.*ttabung;

luasselimutkerucut=22/7*rkerucut.*skerucut;
luaspermukaankerucut=(22/7*rkerucut)+(luasselimutkerucut);
volumekerucut=1/3*22/7*rkerucut.*rkerucut.*tkerucut;

r2kerucut=(skerucut.^2)-(tkerucut.^2);
t2kerucut=(skerucut.^2)-(rkerucut.^2);
s2kerucut=(rkerucut.^2)+(tkerucut.^2);

set(handles.edit28,'String',luaspermukaankubus);
set(handles.edit30,'String',panjangrusukkubus);
set(handles.edit29,'String',diagonalbidangkubus);
set(handles.edit32,'String',diagonalruangkubus);
set(handles.edit31,'String',volumekubus);

set(handles.edit12,'String',luaspermukaanbalok);
set(handles.edit14,'String',panjangrusukbalok);
set(handles.edit13,'String',diagonalruangbalok);
set(handles.edit15,'String',volumebalok);

set(handles.edit16,'String',luaspermukaanbola);
set(handles.edit17,'String',volumebola);

set(handles.edit18,'String',luaspermukaantabung);
set(handles.edit20,'String',luasselimuttabung);
set(handles.edit19,'String',luaspermukaantanpatabung);
set(handles.edit21,'String',volumetabung);

set(handles.edit22,'String',luaspermukaankerucut);
set(handles.edit23,'String',luasselimutkerucut);
set(handles.edit24,'String',volumekerucut);

set(handles.edit25,'String',r2kerucut);
set(handles.edit26,'String',t2kerucut);
set(handles.edit27,'String',s2kerucut);

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

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

% --- 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)
set(handles.edit1,'String',0);
set(handles.edit2,'String',0);
set(handles.edit3,'String',0);
set(handles.edit4,'String',0);
set(handles.edit5,'String',0);
set(handles.edit6,'String',0);
set(handles.edit8,'String',0);
set(handles.edit9,'String',0);
set(handles.edit10,'String',0);
set(handles.edit11,'String',0);

set(handles.edit12,'String',0);
set(handles.edit13,'String',0);
set(handles.edit14,'String',0);
set(handles.edit15,'String',0);
set(handles.edit16,'String',0);
set(handles.edit17,'String',0);
set(handles.edit18,'String',0);
set(handles.edit19,'String',0);
set(handles.edit20,'String',0);
set(handles.edit21,'String',0);
set(handles.edit22,'String',0);
set(handles.edit23,'String',0);
set(handles.edit24,'String',0);
set(handles.edit25,'String',0);
set(handles.edit26,'String',0);
set(handles.edit27,'String',0);
set(handles.edit28,'String',0);
set(handles.edit29,'String',0);
set(handles.edit30,'String',0);
set(handles.edit31,'String',0);
set(handles.edit32,'String',0);

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

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

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


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


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

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


function edit9_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit9 (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 edit10_Callback(hObject, eventdata, handles)
% hObject handle to edit10 (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 edit10 as text


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

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


function edit10_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit10 (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 edit11_Callback(hObject, eventdata, handles)


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


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

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


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

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 edit7 as a
double

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


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


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


% str2double(get(hObject,'String')) returns contents of edit8 as a
double
% --- Executes during object creation, after setting all properties.
function edit8_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit8 (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 edit12_Callback(hObject, eventdata, handles)


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


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

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


function edit12_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit12 (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 edit13_Callback(hObject, eventdata, handles)


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


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

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


function edit13_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit13 (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 edit14_Callback(hObject, eventdata, handles)


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


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

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


function edit14_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit14 (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 edit16_Callback(hObject, eventdata, handles)


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


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

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


function edit16_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit16 (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 edit17_Callback(hObject, eventdata, handles)


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


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

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


function edit17_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit17 (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 edit15_Callback(hObject, eventdata, handles)


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


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

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


function edit15_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit15 (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 edit18_Callback(hObject, eventdata, handles)


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


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

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


function edit18_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit18 (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 edit19_Callback(hObject, eventdata, handles)


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


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

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


function edit19_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit19 (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 edit20_Callback(hObject, eventdata, handles)
% hObject handle to edit20 (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 edit20 as text


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

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


function edit20_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit20 (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 edit21_Callback(hObject, eventdata, handles)


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


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

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


function edit21_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit21 (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 edit22_Callback(hObject, eventdata, handles)


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


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

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


function edit22_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit22 (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 edit23_Callback(hObject, eventdata, handles)


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


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

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


function edit23_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit23 (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 edit24_Callback(hObject, eventdata, handles)


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


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

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


function edit24_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit24 (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 edit25_Callback(hObject, eventdata, handles)


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


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

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


function edit25_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit25 (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 edit26_Callback(hObject, eventdata, handles)


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


% str2double(get(hObject,'String')) returns contents of edit26 as a
double
% --- Executes during object creation, after setting all properties.
function edit26_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit26 (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 edit27_Callback(hObject, eventdata, handles)


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


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

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


function edit27_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit27 (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 edit28_Callback(hObject, eventdata, handles)


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


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

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


function edit28_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit28 (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 edit29_Callback(hObject, eventdata, handles)


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


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

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


function edit29_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit29 (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 edit30_Callback(hObject, eventdata, handles)


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


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

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


function edit30_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit30 (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 edit31_Callback(hObject, eventdata, handles)


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


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

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


function edit31_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit31 (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 edit32_Callback(hObject, eventdata, handles)


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


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

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


function edit32_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit32 (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 edit37_Callback(hObject, eventdata, handles)
% hObject handle to edit37 (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 edit37 as text


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

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


function edit37_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit37 (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 edit38_Callback(hObject, eventdata, handles)


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


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

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


function edit38_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit38 (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 edit39_Callback(hObject, eventdata, handles)
% hObject handle to edit39 (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 edit39 as text


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

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


function edit39_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit39 (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 edit40_Callback(hObject, eventdata, handles)


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


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

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


function edit40_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit40 (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 edit33_Callback(hObject, eventdata, handles)


% hObject handle to edit33 (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 edit33 as text
% str2double(get(hObject,'String')) returns contents of edit33 as a
double

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


function edit33_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit33 (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 edit34_Callback(hObject, eventdata, handles)


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


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

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


function edit34_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit34 (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 edit35_Callback(hObject, eventdata, handles)


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


% str2double(get(hObject,'String')) returns contents of edit35 as a
double
% --- Executes during object creation, after setting all properties.
function edit35_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit35 (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 edit36_Callback(hObject, eventdata, handles)


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


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

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


function edit36_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit36 (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)
% 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)
ivektoru=str2double(get(handles.edit33,'String'));
jvektoru=str2double(get(handles.edit34,'String'));
ivektorv=str2double(get(handles.edit35,'String'));
jvektorv=str2double(get(handles.edit36,'String'));

panjangu=sqrt((ivektoru.^2)+(jvektoru.^2));
panjangv=sqrt((ivektorv.^2)+(jvektorv.^2));
ukaliv=((ivektoru.*ivektorv)+(jvektoru.*jvektorv));
sudutuv=acosd((ukaliv)/(panjangu.*panjangv));
resultanuv=sqrt((panjangu.^2)+(panjangv.^2)+(2*panjangu.*panjangv).*cosd(sudu
tuv));

set(handles.edit37,'String',panjangu);
set(handles.edit38,'String',panjangv);
set(handles.edit39,'String',sudutuv);
set(handles.edit40,'String',resultanuv);

% --- 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)
set(handles.edit33,'String',0);
set(handles.edit34,'String',0);
set(handles.edit35,'String',0);
set(handles.edit36,'String',0);
set(handles.edit37,'String',0);
set(handles.edit38,'String',0);
set(handles.edit39,'String',0);
set(handles.edit40,'String',0);
x=0;y=0;
axes(handles.axes1);
plot(x,y);

% --- Executes on button press in pushbutton7.


function pushbutton7_Callback(hObject, eventdata, handles)
% 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)
ivektoru=str2double(get(handles.edit33,'String'));
jvektoru=str2double(get(handles.edit34,'String'));
ivektorv=str2double(get(handles.edit35,'String'));
jvektorv=str2double(get(handles.edit36,'String'));

panjangu=sqrt((ivektoru.^2)+(jvektoru.^2));
panjangv=sqrt((ivektorv.^2)+(jvektorv.^2));
ukaliv=((ivektoru.*ivektorv)+(jvektoru.*jvektorv));
sudutuv=acosd((ukaliv)/(panjangu.*panjangv));
resultanuv=sqrt((panjangu.^2)+(panjangv.^2)+(2*panjangu.*panjangv).*cosd(sudu
tuv));

x=[0,ivektoru];
y=[0,jvektoru];
x1=[0,ivektorv];
y1=[0,jvektorv];
axes(handles.axes1);
plot(x,y,x1,y1);
legend('xi','xii','3');

function edit43_Callback(hObject, eventdata, handles)


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


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

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


function edit43_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit43 (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 edit44_Callback(hObject, eventdata, handles)


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


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

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


function edit44_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit44 (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 edit45_Callback(hObject, eventdata, handles)


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


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

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


function edit45_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit45 (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 edit46_Callback(hObject, eventdata, handles)


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


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

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


function edit46_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit46 (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 edit41_Callback(hObject, eventdata, handles)


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


% str2double(get(hObject,'String')) returns contents of edit41 as a
double
% --- Executes during object creation, after setting all properties.
function edit41_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit41 (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 edit42_Callback(hObject, eventdata, handles)


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


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

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


function edit42_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit42 (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 slider movement.


function slider1_Callback(hObject, eventdata, handles)
% hObject handle to slider1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
slider1Value=num2str(get(handles.slider1,'Value'));
set(handles.edit41,'String',slider1Value);

sudutslider=str2double(get(handles.edit41,'String'));
kecslider=str2double(get(handles.edit42,'String'));
sinsudut=sind(sudutslider);
cossudut=cosd(sudutslider);
xmaks=((kecslider.^2)*(2*sinsudut.*cossudut))/(10);
ymaks=((kecslider.^2)*(sinsudut.^2))/(2*10);
txmaks=((2*kecslider.*sinsudut)/10);
tymaks=((kecslider.*sinsudut)/10);
set(handles.edit43,'String',xmaks);
set(handles.edit44,'String',ymaks);
set(handles.edit45,'String',txmaks);
set(handles.edit46,'String',tymaks);

voy=kecslider.*sinsudut;
vox=kecslider.*cossudut;
t=0:txmaks/100:txmaks;
y=(voy.*t)-(0.5*10*(t.^2));
x=vox.*t;
axes(handles.axes2) ;plot(x,y) ;

% Hints: get(hObject,'Value') returns position of slider


% get(hObject,'Min') and get(hObject,'Max') to determine range of
slider
slider1Value=num2str(get(handles.slider1,'Value'));
set(handles.edit41,'String',slider1Value);

sudutslider=str2double(get(handles.edit41,'String'));
kecslider=str2double(get(handles.edit42,'String'));
sinsudut=sind(sudutslider);
cossudut=cosd(sudutslider);
xmaks=((kecslider.^2)*(2*sinsudut.*cossudut))/(2*10);
ymaks=((kecslider.^2)*(sinsudut.^2))/(2*10);
txmaks=((2*kecslider.*sinsudut)/10);
tymaks=((kecslider.*sinsudut)/10);

set(handles.edit43,'String',xmaks);
set(handles.edit44,'String',ymaks);
set(handles.edit45,'String',txmaks);
set(handles.edit46,'String',tymaks);

voy=kecslider.*sinsudut;
vox=kecslider.*cossudut;
t=0:txmaks/100:txmaks;
y=(voy.*t)-(0.5*10*(t.^2));
x=vox.*t;
axes(handles.axes2);
plot(x,y);

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


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

% Hint: slider controls usually have a light gray background.


if isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor',[.9 .9 .9]);
end

% --- Executes on slider movement.


function slider2_Callback(hObject, eventdata, handles)
% hObject handle to slider2 (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,'Value') returns position of slider


% get(hObject,'Min') and get(hObject,'Max') to determine range of
slider
slider2Value=num2str(get(handles.slider2,'Value'));
set(handles.edit42,'String',slider2Value);

sudutslider=str2double(get(handles.edit41,'String'));
kecslider=str2double(get(handles.edit42,'String'));
sinsudut=sind(sudutslider);
cossudut=cosd(sudutslider);
xmaks=((kecslider.^2)*(2*sinsudut.*cossudut))/(2*10);
ymaks=((kecslider.^2)*(sinsudut.^2))/(2*10);
txmaks=((2*kecslider.*sinsudut)/10);
tymaks=((kecslider.*sinsudut)/10);

set(handles.edit43,'String',xmaks);
set(handles.edit44,'String',ymaks);
set(handles.edit45,'String',txmaks);
set(handles.edit46,'String',tymaks);

voy=kecslider.*sinsudut;
vox=kecslider.*cossudut;
t=0:txmaks/100:txmaks;
y=(voy.*t)-(0.5*10*(t.^2));
x=vox.*t;
axes(handles.axes2);
plot(x,y);

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


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

% Hint: slider controls usually have a light gray background.


if isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor',[.9 .9 .9]);
end

% --- Executes on key press with focus on slider1 and none of its controls.
function slider1_KeyPressFcn(hObject, eventdata, handles)
% hObject handle to slider1 (see GCBO)
% eventdata structure with the following fields (see
MATLAB.UI.CONTROL.UICONTROL)
% Key: name of the key that was pressed, in lower case
% Character: character interpretation of the key(s) that was pressed
% Modifier: name(s) of the modifier key(s) (i.e., control, shift) pressed
% handles structure with handles and user data (see GUIDATA)

You might also like