No BSD License  

Highlights from
Simulation for Secure Morse Device

image thumbnail
from Simulation for Secure Morse Device by andi yusuf
Secure Morse Simulation

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

% Copyright 2002-2003 The MathWorks, Inc.

% Edit the above text to modify the response to help AYmorse

% Last Modified by GUIDE v2.5 08-Jul-2005 23:43:48

% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
                   'gui_Singleton',  gui_Singleton, ...
                   'gui_OpeningFcn', @AYmorse_OpeningFcn, ...
                   'gui_OutputFcn',  @AYmorse_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 AYmorse is made visible.
function AYmorse_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 AYmorse (see VARARGIN)

% Choose default command line output for AYmorse
handles.output = hObject;

% Update handles structure
guidata(hObject, handles);

% UIWAIT makes AYmorse wait for user response (see UIRESUME)
% uiwait(handles.figure1);


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


% ======================== PENGIRIM =======================================
function input_Callback(hObject, eventdata, handles)
% hObject    handle to input (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 input as text
%        str2double(get(hObject,'String')) returns contents of input as a double


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



% =============================TRANSMISI ==================================
function output1_Callback(hObject, eventdata, handles)
% hObject    handle to output1 (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 output1 as text
%        str2double(get(hObject,'String')) returns contents of output1 as a double


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


% ==========================PENERIMA=========================================
function output2_Callback(hObject, eventdata, handles)
% hObject    handle to output2 (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 output2 as text
%        str2double(get(hObject,'String')) returns contents of output2 as a double


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

%======================= TOMBOL - TOMBOL =======================================================
% --- Executes on button press in morse.
function varargout = morse_Callback(hObject, eventdata, handles)
% hObject    handle to morse (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

inputan = get(handles.input,'String')
parameter = get(handles.secure,'Value')          % kondisi terenkripsi
parameter1 = get(handles.nonsecure,'Value')     % kondisi clear
inputan = upper(inputan);
if parameter == 1
    reg = inputan + 2;
    bates = length(reg);
    for i = 1:bates
        if reg(i)>87
            reg(i)=mod(reg(i),90)+64;
        elseif reg(i)>55 && reg(i)<65
            reg(i)=mod(reg(i),57)+47;
        end
    end
    reg
    outputan = setstr(reg)
    set(handles.output1,'String',outputan);
    morse(outputan)
    set(handles.output2,'String',inputan);
elseif parameter1 == 1
    set(handles.output1,'String',inputan);
    morse(inputan)
    set(handles.output2,'String',inputan);
end

%================================================================================================

% --- Executes on button press in Q.
function varagout = Q_Callback(hObject, eventdata, handles)
% hObject    handle to Q (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
inputan = 'Q';
parameter = get(handles.secure,'Value')          % kondisi terenkripsi
parameter1 = get(handles.nonsecure,'Value')     % kondisi clear
set(handles.input,'String',inputan);
if parameter == 1
    reg = inputan + 2;
    outputan = setstr(reg);
    set(handles.output1,'String',outputan);
    morse(outputan)
    set(handles.output2,'String',inputan);
elseif parameter1 == 1
    set(handles.output1,'String',inputan);
    morse(inputan)
    set(handles.output2,'String',inputan);
end
%==================================================================================================
% --- Executes on button press in W.
function varagout = W_Callback(hObject, eventdata, handles)
% hObject    handle to W (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
inputan = 'W';
parameter = get(handles.secure,'Value')          % kondisi terenkripsi
parameter1 = get(handles.nonsecure,'Value')     % kondisi clear
set(handles.input,'String',inputan);
if parameter == 1
    reg = inputan + 2;
    outputan = setstr(reg);
    set(handles.output1,'String',outputan);
    morse(outputan)
    set(handles.output2,'String',inputan);
elseif parameter1 == 1
    set(handles.output1,'String',inputan);
    morse(inputan)
    set(handles.output2,'String',inputan);
end
%====================================================================================================

% --- Executes on button press in E.
function varagout = E_Callback(hObject, eventdata, handles)
% hObject    handle to E (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
inputan = 'E';
parameter = get(handles.secure,'Value')          % kondisi terenkripsi
parameter1 = get(handles.nonsecure,'Value')     % kondisi clear
set(handles.input,'String',inputan);
if parameter == 1
    reg = inputan + 2;
    outputan = setstr(reg);
    set(handles.output1,'String',outputan);
    morse(outputan)
    set(handles.output2,'String',inputan);
elseif parameter1 == 1
    set(handles.output1,'String',inputan);
    morse(inputan)
    set(handles.output2,'String',inputan);
end
%====================================================================================================
% --- Executes on button press in R.
function varagout = R_Callback(hObject, eventdata, handles)
% hObject    handle to R (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
inputan = 'R';
parameter = get(handles.secure,'Value')          % kondisi terenkripsi
parameter1 = get(handles.nonsecure,'Value')     % kondisi clear
set(handles.input,'String',inputan);
if parameter == 1
    reg = inputan + 2;
    outputan = setstr(reg);
    set(handles.output1,'String',outputan);
    morse(outputan)
    set(handles.output2,'String',inputan);
elseif parameter1 == 1
    set(handles.output1,'String',inputan);
    morse(inputan)
    set(handles.output2,'String',inputan);
end
%=======================================================================================================

% --- Executes on button press in T.
function varagout = T_Callback(hObject, eventdata, handles)
% hObject    handle to T (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
inputan = 'T';
parameter = get(handles.secure,'Value')          % kondisi terenkripsi
parameter1 = get(handles.nonsecure,'Value')     % kondisi clear
set(handles.input,'String',inputan);
if parameter == 1
    reg = inputan + 2;
    outputan = setstr(reg);
    set(handles.output1,'String',outputan);
    morse(outputan)
    set(handles.output2,'String',inputan);
elseif parameter1 == 1
    set(handles.output1,'String',inputan);
    morse(inputan)
    set(handles.output2,'String',inputan);
end
%===========================================================================================================
% --- Executes on button press in Y.
function varagout = Y_Callback(hObject, eventdata, handles)
% hObject    handle to Y (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
inputan = 'Y';
parameter = get(handles.secure,'Value')          % kondisi terenkripsi
parameter1 = get(handles.nonsecure,'Value')     % kondisi clear
set(handles.input,'String',inputan);
if parameter == 1
    reg = mod(inputan + 2,90)+64;
    outputan = setstr(reg);
    set(handles.output1,'String',outputan);
    morse(outputan)
    set(handles.output2,'String',inputan);
elseif parameter1 == 1
    set(handles.output1,'String',inputan);
    morse(inputan)
    set(handles.output2,'String',inputan);
end
%============================================================================================================
% --- Executes on button press in U.
function varagout = U_Callback(hObject, eventdata, handles)
% hObject    handle to U (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
inputan = 'U';
parameter = get(handles.secure,'Value')          % kondisi terenkripsi
parameter1 = get(handles.nonsecure,'Value')     % kondisi clear
set(handles.input,'String',inputan);
if parameter == 1
    reg = inputan + 2;
    outputan = setstr(reg);
    set(handles.output1,'String',outputan);
    morse(outputan)
    set(handles.output2,'String',inputan);
elseif parameter1 == 1
    set(handles.output1,'String',inputan);
    morse(inputan)
    set(handles.output2,'String',inputan);
end
%=============================================================================================================

% --- Executes on button press in A.
function varagout = A_Callback(hObject, eventdata, handles)
% hObject    handle to A (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
inputan = 'A';
parameter = get(handles.secure,'Value')          % kondisi terenkripsi
parameter1 = get(handles.nonsecure,'Value')     % kondisi clear
set(handles.input,'String',inputan);
if parameter == 1
    reg = inputan + 2;
    outputan = setstr(reg);
    set(handles.output1,'String',outputan);
    morse(outputan)
    set(handles.output2,'String',inputan);
elseif parameter1 == 1
    set(handles.output1,'String',inputan);
    morse(inputan)
    set(handles.output2,'String',inputan);
end
%===============================================================================================================
% --- Executes on button press in S.
function varagout = S_Callback(hObject, eventdata, handles)
% hObject    handle to S (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
inputan = 'S';
parameter = get(handles.secure,'Value')          % kondisi terenkripsi
parameter1 = get(handles.nonsecure,'Value')     % kondisi clear
set(handles.input,'String',inputan);
if parameter == 1
    reg = inputan + 2;
    outputan = setstr(reg);
    set(handles.output1,'String',outputan);
    morse(outputan)
    set(handles.output2,'String',inputan);
elseif parameter1 == 1
    set(handles.output1,'String',inputan);
    morse(inputan)
    set(handles.output2,'String',inputan);
end
%==============================================================================================================

% --- Executes on button press in D.
function varagout = D_Callback(hObject, eventdata, handles)
% hObject    handle to D (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
inputan = 'D';
parameter = get(handles.secure,'Value')          % kondisi terenkripsi
parameter1 = get(handles.nonsecure,'Value')     % kondisi clear
set(handles.input,'String',inputan);
if parameter == 1
    reg = inputan + 2;
    outputan = setstr(reg);
    set(handles.output1,'String',outputan);
    morse(outputan)
    set(handles.output2,'String',inputan);
elseif parameter1 == 1
    set(handles.output1,'String',inputan);
    morse(inputan)
    set(handles.output2,'String',inputan);
end
%===============================================================================================================

% --- Executes on button press in I.
function varagout = I_Callback(hObject, eventdata, handles)
% hObject    handle to I (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
inputan = 'I';
parameter = get(handles.secure,'Value')          % kondisi terenkripsi
parameter1 = get(handles.nonsecure,'Value')     % kondisi clear
set(handles.input,'String',inputan);
if parameter == 1
    reg = inputan + 2;
    outputan = setstr(reg);
    set(handles.output1,'String',outputan);
    morse(outputan)
    set(handles.output2,'String',inputan);
elseif parameter1 == 1
    set(handles.output1,'String',inputan);
    morse(inputan)
    set(handles.output2,'String',inputan);
end
%================================================================================================================

% --- Executes on button press in O.
function varagout = O_Callback(hObject, eventdata, handles)
% hObject    handle to O (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
inputan = 'O';
parameter = get(handles.secure,'Value')          % kondisi terenkripsi
parameter1 = get(handles.nonsecure,'Value')     % kondisi clear
set(handles.input,'String',inputan);
if parameter == 1
    reg = inputan + 2;
    outputan = setstr(reg);
    set(handles.output1,'String',outputan);
    morse(outputan)
    set(handles.output2,'String',inputan);
elseif parameter1 == 1
    set(handles.output1,'String',inputan);
    morse(inputan)
    set(handles.output2,'String',inputan);
end
%==================================================================================================================

% --- Executes on button press in P.
function varagout = P_Callback(hObject, eventdata, handles)
% hObject    handle to P (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
inputan = 'P';
parameter = get(handles.secure,'Value')          % kondisi terenkripsi
parameter1 = get(handles.nonsecure,'Value')     % kondisi clear
set(handles.input,'String',inputan);
if parameter == 1
    reg = inputan + 2;
    outputan = setstr(reg);
    set(handles.output1,'String',outputan);
    morse(outputan)
    set(handles.output2,'String',inputan);
elseif parameter1 == 1
    set(handles.output1,'String',inputan);
    morse(inputan)
    set(handles.output2,'String',inputan);
end
%===================================================================================================================

% --- Executes on button press in L.
function varagout = L_Callback(hObject, eventdata, handles)
% hObject    handle to L (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
inputan = 'L';
parameter = get(handles.secure,'Value')          % kondisi terenkripsi
parameter1 = get(handles.nonsecure,'Value')     % kondisi clear
set(handles.input,'String',inputan);
if parameter == 1
    reg = inputan + 2;
    outputan = setstr(reg);
    set(handles.output1,'String',outputan);
    morse(outputan)
    set(handles.output2,'String',inputan);
elseif parameter1 == 1
    set(handles.output1,'String',inputan);
    morse(inputan)
    set(handles.output2,'String',inputan);
end
%=================================================================================================================

% --- Executes on button press in F.
function varagout = F_Callback(hObject, eventdata, handles)
% hObject    handle to F (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
inputan = 'F';
parameter = get(handles.secure,'Value')          % kondisi terenkripsi
parameter1 = get(handles.nonsecure,'Value')     % kondisi clear
set(handles.input,'String',inputan);
if parameter == 1
    reg = inputan + 2;
    outputan = setstr(reg);
    set(handles.output1,'String',outputan);
    morse(outputan)
    set(handles.output2,'String',inputan);
elseif parameter1 == 1
    set(handles.output1,'String',inputan);
    morse(inputan)
    set(handles.output2,'String',inputan);
end
%=================================================================================================================
% --- Executes on button press in G.
function varagout = G_Callback(hObject, eventdata, handles)
% hObject    handle to G (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
inputan = 'G';
parameter = get(handles.secure,'Value')          % kondisi terenkripsi
parameter1 = get(handles.nonsecure,'Value')     % kondisi clear
set(handles.input,'String',inputan);
if parameter == 1
    reg = inputan + 2;
    outputan = setstr(reg);
    set(handles.output1,'String',outputan);
    morse(outputan)
    set(handles.output2,'String',inputan);
elseif parameter1 == 1
    set(handles.output1,'String',inputan);
    morse(inputan)
    set(handles.output2,'String',inputan);
end
%================================================================================================================

% --- Executes on button press in H.
function varagout = H_Callback(hObject, eventdata, handles)
% hObject    handle to H (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
inputan = 'H';
parameter = get(handles.secure,'Value')          % kondisi terenkripsi
parameter1 = get(handles.nonsecure,'Value')     % kondisi clear
set(handles.input,'String',inputan);
if parameter == 1
    reg = inputan + 2;
    outputan = setstr(reg);
    set(handles.output1,'String',outputan);
    morse(outputan)
    set(handles.output2,'String',inputan);
elseif parameter1 == 1
    set(handles.output1,'String',inputan);
    morse(inputan)
    set(handles.output2,'String',inputan);
end
%=================================================================================================================

% --- Executes on button press in J.
function varagout = J_Callback(hObject, eventdata, handles)
% hObject    handle to J (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
inputan = 'J';
parameter = get(handles.secure,'Value')          % kondisi terenkripsi
parameter1 = get(handles.nonsecure,'Value')     % kondisi clear
set(handles.input,'String',inputan);
if parameter == 1
    reg = inputan + 2;
    outputan = setstr(reg);
    set(handles.output1,'String',outputan);
    morse(outputan)
    set(handles.output2,'String',inputan);
elseif parameter1 == 1
    set(handles.output1,'String',inputan);
    morse(inputan)
    set(handles.output2,'String',inputan);
end
%=================================================================================================================

% --- Executes on button press in K.
function varagout = K_Callback(hObject, eventdata, handles)
% hObject    handle to K (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
inputan = 'K';
parameter = get(handles.secure,'Value')          % kondisi terenkripsi
parameter1 = get(handles.nonsecure,'Value')     % kondisi clear
set(handles.input,'String',inputan);
if parameter == 1
    reg = inputan + 2;
    outputan = setstr(reg);
    set(handles.output1,'String',outputan);
    morse(outputan)
    set(handles.output2,'String',inputan);
elseif parameter1 == 1
    set(handles.output1,'String',inputan);
    morse(inputan)
    set(handles.output2,'String',inputan);
end
%===================================================================================================================

% --- Executes on button press in Z.
function varagout = Z_Callback(hObject, eventdata, handles)
% hObject    handle to Z (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
inputan = 'Z';
parameter = get(handles.secure,'Value')          % kondisi terenkripsi
parameter1 = get(handles.nonsecure,'Value')     % kondisi clear
set(handles.input,'String',inputan);
if parameter == 1
    reg = mod(inputan + 2,90)+64;
    outputan = setstr(reg);
    set(handles.output1,'String',outputan);
    morse(outputan)
    set(handles.output2,'String',inputan);
elseif parameter1 == 1
    set(handles.output1,'String',inputan);
    morse(inputan)
    set(handles.output2,'String',inputan);
end
%====================================================================================================================

% --- Executes on button press in C.
function varagout = C_Callback(hObject, eventdata, handles)
% hObject    handle to C (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
inputan = 'C';
parameter = get(handles.secure,'Value')          % kondisi terenkripsi
parameter1 = get(handles.nonsecure,'Value')     % kondisi clear
set(handles.input,'String',inputan);
if parameter == 1
    reg = inputan + 2;
    outputan = setstr(reg);
    set(handles.output1,'String',outputan);
    morse(outputan)
    set(handles.output2,'String',inputan);
elseif parameter1 == 1
    set(handles.output1,'String',inputan);
    morse(inputan)
    set(handles.output2,'String',inputan);
end
%==================================================================================================================

% --- Executes on button press in B.
function varagout = B_Callback(hObject, eventdata, handles)
% hObject    handle to B (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
inputan = 'B';
parameter = get(handles.secure,'Value')          % kondisi terenkripsi
parameter1 = get(handles.nonsecure,'Value')     % kondisi clear
set(handles.input,'String',inputan);
if parameter == 1
    reg = inputan + 2;
    outputan = setstr(reg);
    set(handles.output1,'String',outputan);
    morse(outputan)
    set(handles.output2,'String',inputan);
elseif parameter1 == 1
    set(handles.output1,'String',inputan);
    morse(inputan)
    set(handles.output2,'String',inputan);
end
%==================================================================================================================

% --- Executes on button press in M.
function varagout = M_Callback(hObject, eventdata, handles)
% hObject    handle to M (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
inputan = 'M';
parameter = get(handles.secure,'Value')          % kondisi terenkripsi
parameter1 = get(handles.nonsecure,'Value')     % kondisi clear
set(handles.input,'String',inputan);
if parameter == 1
    reg = inputan + 2;
    outputan = setstr(reg);
    set(handles.output1,'String',outputan);
    morse(outputan)
    set(handles.output2,'String',inputan);
elseif parameter1 == 1
    set(handles.output1,'String',inputan);
    morse(inputan)
    set(handles.output2,'String',inputan);
end
%====================================================================================================================

% --- Executes on button press in X.
function varagout = X_Callback(hObject, eventdata, handles)
% hObject    handle to X (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
inputan = 'X';
parameter = get(handles.secure,'Value')          % kondisi terenkripsi
parameter1 = get(handles.nonsecure,'Value')     % kondisi clear
set(handles.input,'String',inputan);
if parameter == 1
    reg = inputan + 2;
    outputan = setstr(reg);
    set(handles.output1,'String',outputan);
    morse(outputan)
    set(handles.output2,'String',inputan);
elseif parameter1 == 1
    set(handles.output1,'String',inputan);
    morse(inputan)
    set(handles.output2,'String',inputan);
end
%==================================================================================================================

% --- Executes on button press in V.
function varagout = V_Callback(hObject, eventdata, handles)
% hObject    handle to V (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
inputan = 'V';
parameter = get(handles.secure,'Value')          % kondisi terenkripsi
parameter1 = get(handles.nonsecure,'Value')     % kondisi clear
set(handles.input,'String',inputan);
if parameter == 1
    reg = inputan + 2;
    outputan = setstr(reg);
    set(handles.output1,'String',outputan);
    morse(outputan)
    set(handles.output2,'String',inputan);
elseif parameter1 == 1
    set(handles.output1,'String',inputan);
    morse(inputan)
    set(handles.output2,'String',inputan);
end
%===================================================================================================================

% --- Executes on button press in N.
function varagout = N_Callback(hObject, eventdata, handles)
% hObject    handle to N (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
inputan = 'N';
parameter = get(handles.secure,'Value')          % kondisi terenkripsi
parameter1 = get(handles.nonsecure,'Value')     % kondisi clear
set(handles.input,'String',inputan);
if parameter == 1
    reg = inputan + 2;
    outputan = setstr(reg);
    set(handles.output1,'String',outputan);
    morse(outputan)
    set(handles.output2,'String',inputan);
elseif parameter1 == 1
    set(handles.output1,'String',inputan);
    morse(inputan)
    set(handles.output2,'String',inputan);
end
%====================================================================================================================

% --- Executes on button press in nol.
function varagout = nol_Callback(hObject, eventdata, handles)
% hObject    handle to nol (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
inputan = '0';
parameter = get(handles.secure,'Value')          % kondisi terenkripsi
parameter1 = get(handles.nonsecure,'Value')     % kondisi clear
set(handles.input,'String',inputan);
if parameter == 1
    reg = inputan + 2;
    outputan = setstr(reg);
    set(handles.output1,'String',outputan);
    morse(outputan)
    set(handles.output2,'String',inputan);
elseif parameter1 == 1
    set(handles.output1,'String',inputan);
    morse(inputan)
    set(handles.output2,'String',inputan);
end
%==================================================================================================================

% --- Executes on button press in dua.
function varagout = dua_Callback(hObject, eventdata, handles)
% hObject    handle to dua (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
inputan = '2';
parameter = get(handles.secure,'Value')          % kondisi terenkripsi
parameter1 = get(handles.nonsecure,'Value')     % kondisi clear
set(handles.input,'String',inputan);
if parameter == 1
    reg = inputan + 2;
    outputan = setstr(reg);
    set(handles.output1,'String',outputan);
    morse(outputan)
    set(handles.output2,'String',inputan);
elseif parameter1 == 1
    set(handles.output1,'String',inputan);
    morse(inputan)
    set(handles.output2,'String',inputan);
end
%=====================================================================================================================

% --- Executes on button press in empat.
function varagout = empat_Callback(hObject, eventdata, handles)
% hObject    handle to empat (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
inputan = '4';
parameter = get(handles.secure,'Value')          % kondisi terenkripsi
parameter1 = get(handles.nonsecure,'Value')     % kondisi clear
set(handles.input,'String',inputan);
if parameter == 1
    reg = inputan + 2;
    outputan = setstr(reg);
    set(handles.output1,'String',outputan);
    morse(outputan)
    set(handles.output2,'String',inputan);
elseif parameter1 == 1
    set(handles.output1,'String',inputan);
    morse(inputan)
    set(handles.output2,'String',inputan);
end
%===============================================================================================================

% --- Executes on button press in lima.
function varagout = lima_Callback(hObject, eventdata, handles)
% hObject    handle to lima (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
inputan = '5';
parameter = get(handles.secure,'Value')          % kondisi terenkripsi
parameter1 = get(handles.nonsecure,'Value')     % kondisi clear
set(handles.input,'String',inputan);
if parameter == 1
    reg = inputan + 2;
    outputan = setstr(reg);
    set(handles.output1,'String',outputan);
    morse(outputan)
    set(handles.output2,'String',inputan);
elseif parameter1 == 1
    set(handles.output1,'String',inputan);
    morse(inputan)
    set(handles.output2,'String',inputan);
end
%========================================================================================================

% --- Executes on button press in tujuh.
function varagout = tujuh_Callback(hObject, eventdata, handles)
% hObject    handle to tujuh (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
inputan = '7';
parameter = get(handles.secure,'Value')          % kondisi terenkripsi
parameter1 = get(handles.nonsecure,'Value')     % kondisi clear
set(handles.input,'String',inputan);
if parameter == 1
    reg = inputan + 2;
    outputan = setstr(reg);
    set(handles.output1,'String',outputan);
    morse(outputan)
    set(handles.output2,'String',inputan);
elseif parameter1 == 1
    set(handles.output1,'String',inputan);
    morse(inputan)
    set(handles.output2,'String',inputan);
end
%=======================================================================================================

% --- Executes on button press in enam.
function varagout = enam_Callback(hObject, eventdata, handles)
% hObject    handle to enam (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
inputan = '6';
parameter = get(handles.secure,'Value')          % kondisi terenkripsi
parameter1 = get(handles.nonsecure,'Value')     % kondisi clear
set(handles.input,'String',inputan);
if parameter == 1
    reg = inputan + 2;
    outputan = setstr(reg);
    set(handles.output1,'String',outputan);
    morse(outputan)
    set(handles.output2,'String',inputan);
elseif parameter1 == 1
    set(handles.output1,'String',inputan);
    morse(inputan)
    set(handles.output2,'String',inputan);
end
%=======================================================================================================

% --- Executes on button press in satu.
function varagout = satu_Callback(hObject, eventdata, handles)
% hObject    handle to satu (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
inputan = '1';
parameter = get(handles.secure,'Value')          % kondisi terenkripsi
parameter1 = get(handles.nonsecure,'Value')     % kondisi clear
set(handles.input,'String',inputan);
if parameter == 1
    reg = inputan + 2;
    outputan = setstr(reg);
    set(handles.output1,'String',outputan);
    morse(outputan)
    set(handles.output2,'String',inputan);
elseif parameter1 == 1
    set(handles.output1,'String',inputan);
    morse(inputan)
    set(handles.output2,'String',inputan);
end
%======================================================================================================

% --- Executes on button press in smbilan.
function varagout = smbilan_Callback(hObject, eventdata, handles)
% hObject    handle to smbilan (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
inputan = '9';
parameter = get(handles.secure,'Value')          % kondisi terenkripsi
parameter1 = get(handles.nonsecure,'Value')     % kondisi clear
set(handles.input,'String',inputan);
if parameter == 1
    reg = mod(inputan + 2,57)+ 47;
    outputan = setstr(reg);
    set(handles.output1,'String',outputan);
    morse(outputan)
    set(handles.output2,'String',inputan);
elseif parameter1 == 1
    set(handles.output1,'String',inputan);
    morse(inputan)
    set(handles.output2,'String',inputan);
end
%=====================================================================================================

% --- Executes on button press in dlapan.
function varagout = dlapan_Callback(hObject, eventdata, handles)
% hObject    handle to dlapan (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
inputan = '8';
parameter = get(handles.secure,'Value')          % kondisi terenkripsi
parameter1 = get(handles.nonsecure,'Value')     % kondisi clear
set(handles.input,'String',inputan);
if parameter == 1
    reg = mod(inputan + 2,57)+47;
    outputan = setstr(reg);
    set(handles.output1,'String',outputan);
    morse(outputan)
    set(handles.output2,'String',inputan);
elseif parameter1 == 1
    set(handles.output1,'String',inputan);
    morse(inputan)
    set(handles.output2,'String',inputan);
end
%========================================================================================================

% --- Executes on button press in tiga.
function varagout = tiga_Callback(hObject, eventdata, handles)
% hObject    handle to tiga (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
inputan = '3';
parameter = get(handles.secure,'Value')          % kondisi terenkripsi
parameter1 = get(handles.nonsecure,'Value')     % kondisi clear
set(handles.input,'String',inputan);
if parameter == 1
    reg = inputan + 2;
    outputan = setstr(reg);
    set(handles.output1,'String',outputan);
    morse(outputan)
    set(handles.output2,'String',inputan);
elseif parameter1 == 1
    set(handles.output1,'String',inputan);
    morse(inputan)
    set(handles.output2,'String',inputan);
end

%==========================================================================

% --- Executes on button press in clear.
function clear_Callback(hObject, eventdata, handles)
% hObject    handle to clear (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
set(handles.input,'String',' ');
set(handles.output1,'String',' ');
set(handles.output2,'String',' ');

Contact us at files@mathworks.com