0% found this document useful (0 votes)
28 views

Centro de Enseñanza Técnica Industrial

The document describes a MATLAB code for a graphical user interface (GUI) called Matriz3x3 that allows users to perform matrix multiplication of 3x3 matrices. The code defines callbacks for buttons like "reset" and "multiply" that initialize the GUI and perform the multiplication respectively. It also contains functions for opening, outputting from, and creating the GUI window and its components.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views

Centro de Enseñanza Técnica Industrial

The document describes a MATLAB code for a graphical user interface (GUI) called Matriz3x3 that allows users to perform matrix multiplication of 3x3 matrices. The code defines callbacks for buttons like "reset" and "multiply" that initialize the GUI and perform the multiplication respectively. It also contains functions for opening, outputting from, and creating the GUI window and its components.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 21

Centro de Enseñanza Técnica Industrial

Organismo Público Descentralizado Federal

CODIGO DE PROGRAMA

Nombre del Alumno: AARON YIVALDI PEREZ GALAN


IVAN BENJAMIN MORALES HERMOSILLO
MAURICIO CONDE MADERA
GUILLERMO DANIEL CUEVA RAMIREZ
JOSUEA ASSAEL PEÑA SERAFIN
Registro: 17310238
17310206
17310060
17310069
17310216
Carrera: Mecatrónica
Materia: ROBOTICA
Clave: Grupo: G Semestre: 7°
Profesor: NOEL MARCIAL VAZQUEZ SOJO
Parcial: 1 Nombre de la Tarea:
Fecha: 26/SEPTIEMBRE/2020 MATRIZ
Centro de Enseñanza Técnica Industrial
Organismo Público Descentralizado Federal

CODIGO DE PROGRAMA

function varargout = Matriz3x3(varargin)


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

% Last Modified by GUIDE v2.5 26-Sep-2020 19:53:24

% Begin initialization code - DO NOT EDIT


gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @Matriz3x3_OpeningFcn, ...
'gui_OutputFcn', @Matriz3x3_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
Centro de Enseñanza Técnica Industrial
Organismo Público Descentralizado Federal

CODIGO DE PROGRAMA

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


function Matriz3x3_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 Matriz3x3 (see VARARGIN)

% Choose default command line output for Matriz3x3


handles.output = hObject;

% Update handles structure


guidata(hObject, handles);

initialize_gui(hObject, handles, false);

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


% uiwait(handles.figure1);

% --- Outputs from this function are returned to the command line.
function varargout = Matriz3x3_OutputFcn(hObject, eventdata, handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

% Get default command line output from handles structure


varargout{1} = handles.output;

% --- Executes on button press in reset.


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

initialize_gui(gcbf, handles, true);

% --------------------------------------------------------------------
function initialize_gui(fig_handle, handles, isreset)
% If the metricdata field is present and the reset flag is false, it
means
% we are we are just re-initializing a GUI by calling it from the cmd
line
% while it is up. So, bail out as we dont want to reset the data.
Centro de Enseñanza Técnica Industrial
Organismo Público Descentralizado Federal

CODIGO DE PROGRAMA

if isfield(handles, 'metricdata') && ~isreset


return;
end

handles.metricdata.A1 = 0;
handles.metricdata.A2 = 0;
handles.metricdata.A3 = 0;
handles.metricdata.A4 = 0;
handles.metricdata.A5 = 0;
handles.metricdata.A6 = 0;
handles.metricdata.A7 = 0;
handles.metricdata.A8 = 0;
handles.metricdata.A9 = 0;
handles.metricdata.B1 = 0;
handles.metricdata.B2 = 0;
handles.metricdata.B3 = 0;
handles.metricdata.B4 = 0;
handles.metricdata.B5 = 0;
handles.metricdata.B6 = 0;
handles.metricdata.B7 = 0;
handles.metricdata.B8 = 0;
handles.metricdata.B9 = 0;

set(handles.A1, 'String', handles.metricdata.A1);


set(handles.A2, 'String', handles.metricdata.A2);
set(handles.A3, 'String', handles.metricdata.A3);
set(handles.A4, 'String', handles.metricdata.A4);
set(handles.A5, 'String', handles.metricdata.A5);
set(handles.A6, 'String', handles.metricdata.A6);
set(handles.A7, 'String', handles.metricdata.A7);
set(handles.A8, 'String', handles.metricdata.A8);
set(handles.A9, 'String', handles.metricdata.A9);
set(handles.B1, 'String', handles.metricdata.B1);
set(handles.B2, 'String', handles.metricdata.B2);
set(handles.B3, 'String', handles.metricdata.B3);
set(handles.B4, 'String', handles.metricdata.B4);
set(handles.B5, 'String', handles.metricdata.B5);
set(handles.B6, 'String', handles.metricdata.B6);
set(handles.B7, 'String', handles.metricdata.B7);
set(handles.B8, 'String', handles.metricdata.B8);
set(handles.B9, 'String', handles.metricdata.B9);

% Update handles structure


guidata(handles.figure1, handles);

% --- Executes on button press in multiplicar.


function multiplicar_Callback(hObject, eventdata, handles)
% hObject handle to multiplicar (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
Centro de Enseñanza Técnica Industrial
Organismo Público Descentralizado Federal

CODIGO DE PROGRAMA

C1 = ((handles.metricdata.A1 * handles.metricdata.B1) +
(handles.metricdata.A2 * handles.metricdata.B4) + (handles.metricdata.A3
* handles.metricdata.B7));
set(handles.C1, 'string', C1);
C2 = ((handles.metricdata.A1 * handles.metricdata.B2) +
(handles.metricdata.A2 * handles.metricdata.B5) + (handles.metricdata.A3
* handles.metricdata.B8));
set(handles.C2, 'string', C2);
C3 = ((handles.metricdata.A1 * handles.metricdata.B3) +
(handles.metricdata.A2 * handles.metricdata.B6) + (handles.metricdata.A3
* handles.metricdata.B9));
set(handles.C3, 'string', C3);
C4 = ((handles.metricdata.A4 * handles.metricdata.B1) +
(handles.metricdata.A5 * handles.metricdata.B4) + (handles.metricdata.A6
* handles.metricdata.B7));
set(handles.C4, 'string', C4);
C5 = ((handles.metricdata.A4 * handles.metricdata.B2) +
(handles.metricdata.A5 * handles.metricdata.B5) + (handles.metricdata.A6
* handles.metricdata.B8));
set(handles.C5, 'string', C5);
C6 = ((handles.metricdata.A4 * handles.metricdata.B3) +
(handles.metricdata.A5 * handles.metricdata.B6) + (handles.metricdata.A6
* handles.metricdata.B9));
set(handles.C6, 'string', C6);
C7 = ((handles.metricdata.A7 * handles.metricdata.B1) +
(handles.metricdata.A8 * handles.metricdata.B4) + (handles.metricdata.A9
* handles.metricdata.B7));
set(handles.C7, 'string', C7);
C8 = ((handles.metricdata.A7 * handles.metricdata.B2) +
(handles.metricdata.A8 * handles.metricdata.B5) + (handles.metricdata.A9
* handles.metricdata.B8));
set(handles.C8, 'string', C8);
C9 = ((handles.metricdata.A7 * handles.metricdata.B3) +
(handles.metricdata.A8 * handles.metricdata.B6) + (handles.metricdata.A9
* handles.metricdata.B9));
set(handles.C9, 'string', C9);
% --- Executes on button press in RESET.
function RESET_Callback(hObject, eventdata, handles)
% hObject handle to RESET (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
initialize_gui(gcbf, handles, true);

function A1_Callback(hObject, eventdata, handles)


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


% str2double(get(hObject,'String')) returns contents of A1 as a
double
Centro de Enseñanza Técnica Industrial
Organismo Público Descentralizado Federal

CODIGO DE PROGRAMA

A1 = str2double(get(hObject, 'string'));
if isnan(A1)
set(hObject,'string', 0);
errordlg('Debe de colocar un numero', 'ERROR');
end
%save the new A1 value
handles.metricdata.A1 = A1;
guidata(hObject,handles)

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


function A1_CreateFcn(hObject, eventdata, handles)
% hObject handle to A1 (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 A2_Callback(hObject, eventdata, handles)


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


% str2double(get(hObject,'String')) returns contents of A2 as a
double
A2 = str2double(get(hObject, 'string'));
if isnan(A2)
set(hObject,'string', 0);
errordlg('Debe de colocar un numero', 'ERROR');
end
%save the new A1 value
handles.metricdata.A2 = A2;
guidata(hObject,handles)

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


function A2_CreateFcn(hObject, eventdata, handles)
% hObject handle to A2 (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'))
Centro de Enseñanza Técnica Industrial
Organismo Público Descentralizado Federal

CODIGO DE PROGRAMA

set(hObject,'BackgroundColor','white');
end

function A3_Callback(hObject, eventdata, handles)


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


% str2double(get(hObject,'String')) returns contents of A3 as a
double
A3 = str2double(get(hObject, 'string'));
if isnan(A3)
set(hObject,'string', 0);
errordlg('Debe de colocar un numero', 'ERROR');
end
%save the new A1 value
handles.metricdata.A3 = A3;
guidata(hObject,handles)

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


function A3_CreateFcn(hObject, eventdata, handles)
% hObject handle to A3 (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 A4_Callback(hObject, eventdata, handles)


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


% str2double(get(hObject,'String')) returns contents of A4 as a
double
A4 = str2double(get(hObject, 'string'));
if isnan(A4)
set(hObject,'string', 0);
errordlg('Debe de colocar un numero', 'ERROR');
end
%save the new A1 value
Centro de Enseñanza Técnica Industrial
Organismo Público Descentralizado Federal

CODIGO DE PROGRAMA

handles.metricdata.A4 = A4;
guidata(hObject,handles)

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


function A4_CreateFcn(hObject, eventdata, handles)
% hObject handle to A4 (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 A5_Callback(hObject, eventdata, handles)


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


% str2double(get(hObject,'String')) returns contents of A5 as a
double
A5 = str2double(get(hObject, 'string'));
if isnan(A5)
set(hObject,'string', 0);
errordlg('Debe de colocar un numero', 'ERROR');
end

%save the new A1 value


handles.metricdata.A5 = A5;
guidata(hObject,handles)

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


function A5_CreateFcn(hObject, eventdata, handles)
% hObject handle to A5 (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
Centro de Enseñanza Técnica Industrial
Organismo Público Descentralizado Federal

CODIGO DE PROGRAMA

function A6_Callback(hObject, eventdata, handles)


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


% str2double(get(hObject,'String')) returns contents of A6 as a
double
A6 = str2double(get(hObject, 'string'));
if isnan(A6)
set(hObject,'string', 0);
errordlg('Debe de colocar un numero', 'ERROR');
end
%save the new A1 value
handles.metricdata.A6 = A6;
guidata(hObject,handles)

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


function A6_CreateFcn(hObject, eventdata, handles)
% hObject handle to A6 (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 A7_Callback(hObject, eventdata, handles)


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


% str2double(get(hObject,'String')) returns contents of A7 as a
double
A7 = str2double(get(hObject, 'string'));
if isnan(A7)
set(hObject,'string', 0);
errordlg('Debe de colocar un numero', 'ERROR');
end
%save the new A1 value
handles.metricdata.A7 = A7;
guidata(hObject,handles)

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


Centro de Enseñanza Técnica Industrial
Organismo Público Descentralizado Federal

CODIGO DE PROGRAMA

function A7_CreateFcn(hObject, ~, handles)


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


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


% str2double(get(hObject,'String')) returns contents of A8 as a
double
A8 = str2double(get(hObject, 'string'));
if isnan(A8)
set(hObject,'string', 0);
errordlg('Debe de colocar un numero', 'ERROR');
end
%save the new A1 value
handles.metricdata.A8 = A8;
guidata(hObject,handles)

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


function A8_CreateFcn(hObject, eventdata, handles)
% hObject handle to A8 (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 A9_Callback(hObject, eventdata, handles)


% hObject handle to A9 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
Centro de Enseñanza Técnica Industrial
Organismo Público Descentralizado Federal

CODIGO DE PROGRAMA

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


% str2double(get(hObject,'String')) returns contents of A9 as a
double
A9 = str2double(get(hObject, 'string'));
if isnan(A9)
set(hObject,'string', 0);
errordlg('Debe de colocar un numero', 'ERROR');
end
%save the new A1 value
handles.metricdata.A9 = A9;
guidata(hObject,handles)

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


function A9_CreateFcn(hObject, eventdata, handles)
% hObject handle to A9 (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 B1_Callback(hObject, eventdata, handles)


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


% str2double(get(hObject,'String')) returns contents of B1 as a
double
B1 = str2double(get(hObject, 'string'));
if isnan(B1)
set(hObject,'string', 0);
errordlg('Debe de colocar un numero', 'ERROR');
end
%save the new A1 value
handles.metricdata.B1 = B1;
guidata(hObject,handles)

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


function B1_CreateFcn(hObject, eventdata, handles)
% hObject handle to B1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns
called
Centro de Enseñanza Técnica Industrial
Organismo Público Descentralizado Federal

CODIGO DE PROGRAMA

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


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


% str2double(get(hObject,'String')) returns contents of B2 as a
double
B2 = str2double(get(hObject, 'string'));
if isnan(B2)
set(hObject,'string', 0);
errordlg('Debe de colocar un numero', 'ERROR');
end
%save the new A1 value
handles.metricdata.B2 = B2;
guidata(hObject,handles)

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


function B2_CreateFcn(hObject, eventdata, handles)
% hObject handle to B2 (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 B3_Callback(hObject, eventdata, handles)


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


% str2double(get(hObject,'String')) returns contents of B3 as a
double
B3 = str2double(get(hObject, 'string'));
Centro de Enseñanza Técnica Industrial
Organismo Público Descentralizado Federal

CODIGO DE PROGRAMA

if isnan(B3)
set(hObject,'string', 0);
errordlg('Debe de colocar un numero', 'ERROR');
end
%save the new A1 value
handles.metricdata.B3 = B3;
guidata(hObject,handles)

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


function B3_CreateFcn(hObject, eventdata, handles)
% hObject handle to B3 (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 B4_Callback(hObject, eventdata, handles)


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


% str2double(get(hObject,'String')) returns contents of B4 as a
double
B4 = str2double(get(hObject, 'String'));
if isnan(B4)
set(hObject,'String', 0);
errordlg('Debe de colocar un numero', 'ERROR');
end
%save the new A1 value
handles.metricdata.B4 = B4;
guidata(hObject,handles)
% --- Executes during object creation, after setting all properties.
function B4_CreateFcn(hObject, eventdata, handles)
% hObject handle to B4 (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
Centro de Enseñanza Técnica Industrial
Organismo Público Descentralizado Federal

CODIGO DE PROGRAMA

function B5_Callback(hObject, eventdata, handles)


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


% str2double(get(hObject,'String')) returns contents of B5 as a
double
B5 = str2double(get(hObject, 'string'));
if isnan(B5)
set(hObject,'string', 0);
errordlg('Debe de colocar un numero', 'ERROR');
end
%save the new A1 value
handles.metricdata.B5 = B5;
guidata(hObject,handles)

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


function B5_CreateFcn(hObject, eventdata, handles)
% hObject handle to B5 (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 B6_Callback(hObject, eventdata, handles)


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


% str2double(get(hObject,'String')) returns contents of B6 as a
double
B6 = str2double(get(hObject, 'string'));
if isnan(B6)
set(hObject,'string', 0);
errordlg('Debe de colocar un numero', 'ERROR');
end
%save the new A1 value
handles.metricdata.B6 = B6;
Centro de Enseñanza Técnica Industrial
Organismo Público Descentralizado Federal

CODIGO DE PROGRAMA

guidata(hObject,handles)

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


function B6_CreateFcn(hObject, eventdata, handles)
% hObject handle to B6 (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 B7_Callback(hObject, eventdata, handles)


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


% str2double(get(hObject,'String')) returns contents of B7 as a
double
B7 = str2double(get(hObject, 'string'));
if isnan(B7)
set(hObject,'string', 0);
errordlg('Debe de colocar un numero', 'ERROR');
end

%save the new A1 value


handles.metricdata.B7 = B7;
guidata(hObject,handles)

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


function B7_CreateFcn(hObject, eventdata, handles)
% hObject handle to B7 (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
Centro de Enseñanza Técnica Industrial
Organismo Público Descentralizado Federal

CODIGO DE PROGRAMA

function B8_Callback(hObject, eventdata, handles)


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


% str2double(get(hObject,'String')) returns contents of B8 as a
double
B8 = str2double(get(hObject, 'string'));
if isnan(B8)
set(hObject,'string', 0);
errordlg('Debe de colocar un numero', 'ERROR');
end
%save the new A1 value
handles.metricdata.B8 = B8;
guidata(hObject,handles)
% --- Executes during object creation, after setting all properties.
function B8_CreateFcn(hObject, eventdata, handles)
% hObject handle to B8 (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 B9_Callback(hObject, eventdata, handles)


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


% str2double(get(hObject,'String')) returns contents of B9 as a
double
B9 = str2double(get(hObject, 'string'));
if isnan(B9)
set(hObject,'string', 0);
errordlg('Debe de colocar un numero', 'ERROR');
end
%save the new A1 value
handles.metricdata.B9 = B9;
guidata(hObject,handles)

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


function B9_CreateFcn(hObject, eventdata, handles)
% hObject handle to B9 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
Centro de Enseñanza Técnica Industrial
Organismo Público Descentralizado Federal

CODIGO DE PROGRAMA

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


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


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

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


function C1_CreateFcn(hObject, eventdata, handles)
% hObject handle to C1 (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 C2_Callback(hObject, eventdata, handles)


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


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

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


function C2_CreateFcn(hObject, eventdata, handles)
% hObject handle to C2 (see GCBO)
Centro de Enseñanza Técnica Industrial
Organismo Público Descentralizado Federal

CODIGO DE PROGRAMA

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


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


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

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


function C3_CreateFcn(hObject, eventdata, handles)
% hObject handle to C3 (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 C4_Callback(hObject, eventdata, handles)


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


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

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


function C4_CreateFcn(hObject, eventdata, handles)
Centro de Enseñanza Técnica Industrial
Organismo Público Descentralizado Federal

CODIGO DE PROGRAMA

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


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


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

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


function C5_CreateFcn(hObject, eventdata, handles)
% hObject handle to C5 (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 C6_Callback(hObject, eventdata, handles)


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


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

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


Centro de Enseñanza Técnica Industrial
Organismo Público Descentralizado Federal

CODIGO DE PROGRAMA

function C6_CreateFcn(hObject, eventdata, handles)


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


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


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

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


function C7_CreateFcn(hObject, eventdata, handles)
% hObject handle to C7 (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 C8_Callback(hObject, eventdata, handles)


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


% str2double(get(hObject,'String')) returns contents of C8 as a
double
Centro de Enseñanza Técnica Industrial
Organismo Público Descentralizado Federal

CODIGO DE PROGRAMA

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


function C8_CreateFcn(hObject, eventdata, handles)
% hObject handle to C8 (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 C9_Callback(hObject, eventdata, handles)


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


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

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


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

LINK DEL VIDEO EXPLICANDO


https://www.youtube.com/watch?v=8A
2IN9JTJe0&feature=youtu.be

You might also like