Está en la página 1de 18

UNIDAD 2 Y 3. FASE 6. DISEÑAR Y EJECUTAR EL PLAN DE ACCIÓN.

CONSTRUCCIÓN GRUPAL DE LA SOLUCIÓN

PRESENTADO POR:

JAKSON ORLANDO CHAVEZ BERNAL COD: 3029298

JOSÉ RICARDO ARCHILA DUEÑAS COD: 74362743

IVAN DARIO LOPEZ DAZA COD: 17592377

E4

E5

GRUPO 203036_6

PRESENTADO A:

ESP. JOHN JAIRO LEIVA

UNIVERSIDAD NACIONAL ABIERTA Y A DISTANCIA - UNAD

VICERRECTORÍA ACADÉMICA Y DE INVESTIGACIÓN - VIACI

ESCUELA DE CIENCIAS BÁSICAS TECNOLOGÍA E INGENIERÍA – ECBTI

SOFTWARE PARA INGENIERÍA

JUNIO DE 2017
Introducción
Las herramientas con las que contamos en la actualidad y los continuos cambios tecnológicos

han generado una reacción positiva en nuestro diario vivir, facilitándonos la ejecución de

actividades tanto cotidianas como empresariales.

Con el presente trabajo deseamos facilitar la identificación de las resistencias, donde el usuario

ingresara el código de colores o en su defecto el valor de la misma y el programa dará como

resultado el inverso del ingresado, por medio de un programa realizado con la herramienta

matemática de Matlab.
Construcción Grupal
Algoritmo debidamente comentado

software.m

Este código es el principal, la ejecutar este corre el aplicativo desarrollado.

%Software para ingenieria


%Grupo 203036_6

function varargout = software(varargin)


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

% Last Modified by GUIDE v2.5 11-May-2017 12:05:51

% Begin initialization code - DO NOT EDIT


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


function software_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 software (see VARARGIN)

% Choose default command line output for software


handles.output = hObject;

% Inicia las graficas (imagnes) en las condiciones iniciales


valores_iniciales(handles);
% Inicia y guarda los valores de la resistencia
b(1) = 0;
b(2) = 0;
b(3) = 1;
handles.b = b;

% Update handles structure


guidata(hObject, handles);

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


% uiwait(handles.figure1);

% --- Outputs from this function are returned to the command line.
function varargout = software_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 selection change in popupmenu1.


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

% Hints: contents = cellstr(get(hObject,'String')) returns popupmenu1


contents as cell array
% contents{get(hObject,'Value')} returns selected item from popupmenu1
contents = get(hObject,'String');
v = contents{get(hObject,'Value')};
% Se sube el color que se selecciona
color(1, v, handles);
% Se sube el valor de la resistencia
handles.b(1) = str2num(v(1)) * 10;
valor(handles);
% Se guardan los valores
guidata(hObject, handles);

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


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

% Hint: popupmenu 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 selection change in popupmenu2.


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

% Hints: contents = cellstr(get(hObject,'String')) returns popupmenu2


contents as cell array
% contents{get(hObject,'Value')} returns selected item from popupmenu2

contents = get(hObject,'String');
v = contents{get(hObject,'Value')};
% el mismo codigo anterior pero para la segunda franja
color(2, v, handles);
%Valor de la resistencia
handles.b(2) = str2num(v(1));
valor(handles);
% Se guardan los valores
guidata(hObject, handles);

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


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

% Hint: popupmenu 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 selection change in popupmenu3.


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

% Hints: contents = cellstr(get(hObject,'String')) returns popupmenu3


contents as cell array
% contents{get(hObject,'Value')} returns selected item from popupmenu3

contents = get(hObject,'String');
v = contents{get(hObject,'Value')};
% El mismo codigo pero en la tercera banda
color(3, v, handles);
% Valor de la resistencia
handles.b(3) = 10^(str2num(v(1)));
valor(handles);
% Se guardan los valores
guidata(hObject, handles);

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


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

% Hint: popupmenu 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 selection change in popupmenu4.


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

% Hints: contents = cellstr(get(hObject,'String')) returns popupmenu4


contents as cell array
% contents{get(hObject,'Value')} returns selected item from popupmenu4

contents = cellstr(get(hObject,'String'));
v = contents{get(hObject,'Value')};
%contents = get(hObject,'String');
%v = contents{get(hObject,'Value')};
%Este switch se crea para ingresar el valor del porcentaje de error
switch v
case ' 5 Dorado'
set(handles.text7, 'String', '± 5%');
case '10 Plateado'
set(handles.text7, 'String', '± 10%');
end
% El mismo codigo pero en la cuarta banda
color(4, v, handles);
% Se guardan los valores
guidata(hObject, handles);

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


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

% Hint: popupmenu 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

valores_iniciales.m

Este código es el encargado de ingresar los colores iniciales en el interfaz del aplicativo

%Esta funcion inicia las graficas para que muestre los colores iniciales

function valores_iniciales(handles)

axes(handles.axes1);
image(imread('Cafe.jpg'));
axis off;

axes(handles.axes2);
image(imread('Negro.jpg'));
axis off;

axes(handles.axes3);
image(imread('Negro.jpg'));
axis off;

axes(handles.axes4);
image(imread('Dorado.jpg'));
axis off;
color.m

Este código es el encargado de seleccionar el color que el usuario ha escogido.

% Esta funcion agrega la imagen que se selecciona en el menu

function color(ax, val, handles)


switch ax
case 1
axes(handles.axes1);
case 2
axes(handles.axes2);
case 3
axes(handles.axes3);
case 4
axes(handles.axes4);
end

% en esta seccion cuandi se selecciona el color en el menu


%La funcion busca el color en las imagenes
color = val(5 : length(val));
image(imread([color '.jpg']));
axis off;

valor.m

Este código es el encargado de mostrar el valor en ohm que el usuario ha seleccionado. Este

código hace el cálculo de seleccionar el prefijo según la tercera banda de la resistencia.

% Dependiendo del color o valor que se selecciona


%Se muestra el valor de la resistencia

function valor(handles)
b = handles.b;

b_ttl = (b(1) + b(2)) * b(3);

if b_ttl < 1000


b_str = num2str(b_ttl);
end

% Formato del numero


% Por ejemplo, si la resistencia es de valor 1000 se muestra K
bs1 = num2str(b(1)/10);
bs2 = num2str(b(2));
switch b(3)
case 1e2
b_str = [bs1 '.' bs2 ' K'];
case 1e3
b_str = [bs1 bs2 ' K'];
case 1e4
b_str = [bs1 bs2 '0 K'];
case 1e5
b_str = [bs1 '.' bs2 ' M'];
case 1e6
b_str = [bs1 bs2 ' M'];
case 1e7
b_str = [bs1 bs2 '0 M'];
case 1e8
b_str = [bs1 '.' bs2 ' G'];
case 1e9
b_str = [bs1 bs2 ' G'];
end
% El valor se muestra en el static text
set(handles.text2, 'String', b_str);

Código fuente de la solución del problema

%Software para ingenieria


%Grupo 203036_6

function varargout = software(varargin)


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

% Last Modified by GUIDE v2.5 11-May-2017 12:05:51

% Begin initialization code - DO NOT EDIT


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


function software_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 software (see VARARGIN)

% Choose default command line output for software


handles.output = hObject;

% Inicia las graficas (imagnes) en las condiciones iniciales


valores_iniciales(handles);
% Inicia y guarda los valores de la resistencia
b(1) = 0;
b(2) = 0;
b(3) = 1;
handles.b = b;

% Update handles structure


guidata(hObject, handles);

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


% uiwait(handles.figure1);

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

% Hints: contents = cellstr(get(hObject,'String')) returns popupmenu1


contents as cell array
% contents{get(hObject,'Value')} returns selected item from popupmenu1

contents = get(hObject,'String');
v = contents{get(hObject,'Value')};
% Se sube el color que se selecciona
color(1, v, handles);
% Se sube el valor de la resistencia
handles.b(1) = str2num(v(1)) * 10;
valor(handles);
% Se guardan los valores
guidata(hObject, handles);

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


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

% Hint: popupmenu 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 selection change in popupmenu2.


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

% Hints: contents = cellstr(get(hObject,'String')) returns popupmenu2


contents as cell array
% contents{get(hObject,'Value')} returns selected item from popupmenu2

contents = get(hObject,'String');
v = contents{get(hObject,'Value')};
% el mismo codigo anterior pero para la segunda franja
color(2, v, handles);
%Valor de la resistencia
handles.b(2) = str2num(v(1));
valor(handles);
% Se guardan los valores
guidata(hObject, handles);
% --- Executes during object creation, after setting all properties.
function popupmenu2_CreateFcn(hObject, eventdata, handles)
% hObject handle to popupmenu2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called

% Hint: popupmenu 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 selection change in popupmenu3.


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

% Hints: contents = cellstr(get(hObject,'String')) returns popupmenu3


contents as cell array
% contents{get(hObject,'Value')} returns selected item from popupmenu3

contents = get(hObject,'String');
v = contents{get(hObject,'Value')};
% El mismo codigo pero en la tercera banda
color(3, v, handles);
% Valor de la resistencia
handles.b(3) = 10^(str2num(v(1)));
valor(handles);
% Se guardan los valores
guidata(hObject, handles);

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


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

% Hint: popupmenu 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 selection change in popupmenu4.


function popupmenu4_Callback(hObject, eventdata, handles)
% hObject handle to popupmenu4 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: contents = cellstr(get(hObject,'String')) returns popupmenu4
contents as cell array
% contents{get(hObject,'Value')} returns selected item from popupmenu4

contents = cellstr(get(hObject,'String'));
v = contents{get(hObject,'Value')};
%contents = get(hObject,'String');
%v = contents{get(hObject,'Value')};
%Este switch se crea para ingresar el valor del porcentaje de error
switch v
case ' 5 Dorado'
set(handles.text7, 'String', '± 5%');
case '10 Plateado'
set(handles.text7, 'String', '± 10%');
end
% El mismo codigo pero en la cuarta banda
color(4, v, handles);
% Se guardan los valores
guidata(hObject, handles);

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


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

% Hint: popupmenu 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
Capturas de pantalla del funcionamiento del aplicativo
Rubrica de evaluación

Ítem de evaluación Puntaje (1 a 10)

Aplicativo desarrollado intuitivo y fácil de


8
utilizar.

Comprende el lenguaje de programación 6

Conocimientos de idioma ingles 8


Conclusiones
Partiendo de la base de que en la actualidad, son muchos los productos, tecnologías,

dispositivos y herramientas de software libre que se utilizan como estándares, protocolos y

políticas de seguridad, vitales para minimizar aquellos riesgos informáticos que vulneran la

infraestructura computacional y/o la información de las organizaciones.

Para nuestro aprendizaje y formación de las profesiones a fines este trabajo colaborativo nos ha

permitido comprender de que manera se pueden crear herramientas de gestión para determinada

labor, ya que este software MATLAB permite crear una estructura basada en algoritmos y

códigos los cuales hacen más útil las herramientas tecnológicas que a diario utilizamos.
Referencias Bibliográficas
 Mathews, J. H., & Fink, K. D. (2000). Métodos numéricos con Matlab (Vol. 2). A. F.

Carrión, & M. C. Márquez (Eds.). Prentice Hall.

 Hanselman, D., & Littlefield, B. (2001). Mastering MATLAB 6: a comprehensive

tutorial and reference. Pearson.

 Trefethen, L. N. (2000). Spectral methods in MATLAB. Society for Industrial and

Applied Mathematics.

 Hanselman, D. C., & Littlefield, B. (2005). Mastering matlab 7. Pearson/Prentice Hall.

También podría gustarte