Documente Academic
Documente Profesional
Documente Cultură
Curso:
Software para Ingeniera
Alumno:
CARLOS ALBERTO HOYA SANJUAN
Grupo No. 203036_25
Tutor:
JUAN MONROY
Segn la propuesta por el grupo, donde se realiza una secuencia de las fases. Pienso
implementarla de la siguiente manera:
Estudiar de manera precisa el uso, manejo de las matrices en Matlab. Como una
manera de controlar la informacin, almacenamiento y manipulacin del bit que nos
informan en el problema.
Segn los ejercicios realizados en las prcticas se pueden utilizar para solucionar
el problema.
En la etapa de mostrar el tiempo de cada fase, me valdr de una matriz de 10*5 donde
Inicio = FASES
Inicio = software propio de Guide.
b(2, 1:3)=1
b(2:8,3)=1
b(8,:) = 1
Escribir b
Escribir M
retro = a;
hacer para i = 1 : a;
hacer para j= 1:5
si retro = 0 entonces
Salir de ciclo
Fin si
retro = retro -1
M(i,j) = retro
c = Cuadro de texto 2
M = matriz ceros(10,5)
d= M;
d(2,:) = (1)
d(2:6,5) = (1);
d(6,:) = (1);
d(7:9,1) = (1);
d(9,:) = (1)
Escribir = Cuadro de texto 5, d
Esperar 5 segundos
retro2 = c;
Hacer para i = 1 a c
Hacer para j= 1 a 5
si retro2 = 0 entonces
Salir del ciclo
Fin si
retro2 = retro2 -1;
M(i,j) = retro2;
Escribir Cuadro de texto 5,M
Esperar 1 segundo
M(i,j) = 1
Escribir Cuadro de texto 5, M
Esperar 1 segundo
fin para
fin para
fin Botn Dos
e = Cuadro de texto 3
M = Matriz ceros (10,5)
f = M;
f(2,:) = 1
f(6, :) = 1
f(9 ,:) = 1
f(2:9,5)= 1
retro3 = e;
Hacer para i = 1 a e;
Hacer para j= 1 a 5
si retro3 = 0 Entonces
Salir del ciclo
Fin si
retro3 = retro3 -1
M(i,j) = retro3;
Escribir Cuadro de texto 5 , M
Esperar 1 segundo
M(i,j) = 1;
Escribir Cuadro de texto 5 ,M
Esperar 1 segundo
Fin para
Fin para
Fin Botn Tres
Hacer para t = 1 a 3
Elegir caso t ;
Caso 1
Escribir Fase 1 en curso
Botn 1 = Amarillo
a = Cuadro de texto 1
M= matriz ceros[10,5]
b = M
b(2, 1:3)=1
b(2:8,3)=1
b(8,:) = 1
hacer para i = 1 : a;
hacer para j= 1:5
si retro = 0 entonces
Salir de ciclo
Fin si
retro = retro -1
M(i,j) = retro
Caso 2
c = Cuadro de texto 3
M = matriz ceros(10,5)
d= M;
d(2,:) = (1)
d(2:6,5) = (1);
d(6,:) = (1);
d(7:9,1) = (1);
d(9,:) = (1)
Escribir = Cuadro de texto 5 , d
Esperar 5 segundos
retro2 = c;
Hacer para i = 1 a c
Hacer para j= 1 a 5
si retro2 = 0 entonces
Salir del ciclo
Fin si
retro2 = retro2 -1;
M(i,j) = retro2;
Escribir Cuadro de texto 5 ,M
Esperar 1 segundo
M(i,j) = 1
Escribir Cuadro de texto 5 , M
Esperar 1 segundo
fin para
fin para
Caso 3
Escribir Fase 3 en curso
Boton Tres = Naranja
e = Cuadro de texto 3
M = Matriz ceros (10,5)
f = M;
f(2,:) = 1
f(6, :) = 1
f(9 ,:) = 1
f(2:9,5)= 1
retro3 = e;
Hacer para i = 1 a e;
Hacer para j= 1 a 5
si retro3 = 0 Entonces
Salir del ciclo
Fin si
retro3 = retro3 -1
M(i,j) = retro3;
Escribir Cuadro de texto 5 , M
Esperar 1 segundo
M(i,j) = 1;
Escribir Cuadro de texto 5 ,M
Esperar 1 segundo
Fin para
Fin para
end
% ***********************************************************************
% Funcin del boton de arranque de la primera fase.
%************************************************************************
function pushbutton1_Callback(hObject, eventdata, handles)
% Se al pulsar se cambia de color a amarillo cambia de nombre el
% el boton
set(handles. pushbutton1,'String','Fase 1 en curso ')
set(handles.edit5,'BackGroundColor','yellow')
a = str2double(get(handles.edit2,'String'));
if a <=5
set(handles. text3,'String','Ingrese un numero mayor 5 ')
return
esperar 2 segundos;
end
if a > 50
set(handles. text3,'String','Ingrese un numero mayor 5 ')
return
esperar 2 segundos;
end
b(2, 1:3)=(1);
b(2:8,3)=(1);
b(8,:) = (1)
set(handles.edit5,'String',num2str(b));
pause (5)% Se espera 5 segundos
set(handles.edit5,'String',num2str(M));
retro = a;
for i = 1 : a;
for j= 1:5
if retro == 0
return
end
retro = retro -1
M(i,j) = retro;
set(handles.edit5,'String',num2str(M));
pause(1)
M(i,j) = 1;
set(handles.edit5,'String',num2str(M));
pause(1)
end
end
% ***********************************************************************
% Funcin del boton de arranque de la Segunda fase.
%************************************************************************
c = str2double(get(handles.edit3,'String'));
if c <=5
set(handles. text3,'String','Ingrese un numero mayor 5 ')
return
esperar 2 segundos;
end
if c > 50
set(handles. text3,'String','Ingrese un numero mayor 50 ')
return
esperar 2 segundos;
end
pause (5);
set(handles.edit5,'String',num2str(d));
retro2 = c;
for i = 1 : c;
for j= 1:5
if retro2 == 0
return
end
retro2 = retro2 -1;
M(i,j) = retro2;
set(handles.edit5,'String',num2str(M));
pause(1)
M(i,j) = 1;
set(handles.edit5,'String',num2str(M));
pause(1)
home
end
end
% ***********************************************************************
% Funcin del boton de arranque de la Tercera fase.
%************************************************************************
e = str2double(get(handles.edit4,'String'));
if e <=5
set(handles. text3,'String','Ingrese un numero mayor 5 ')
return
esperar 2 segundos;
end
if e > 50
set(handles. text3,'String','Ingrese un numero mayor 5 ')
return
esperar 2 segundos;
end
M = zeros(10,5);
f = M;
% Se cambian los valores en las filas o columnas por unos en la matriz
f(2,:) = (1);
f(6, :) = (1);
f(9 ,:) = (1);
f(2:9,5) = (1)
set(handles.edit5,'String',num2str(f));
pause (5)
set(handles.edit5,'String',num2str(M));
retro3 = e;
for i = 1 : e;
for j= 1:5
if retro3 == 0
return
end
retro3 = retro3 -1;
M(i,j) = retro3;
set(handles.edit5,'String',num2str(M));
pause(1)
M(i,j) = 1;
set(handles.edit5,'String',num2str(M));
pause(1)
end
end
% ***********************************************************************
% Funcin del boton de arranque de la primera fase hasta la fase tres
%************************************************************************
for t = 1 : 3 ;
switch t ;
case 1 % *****COMIENZA LA FASE 1 ********************
a = str2double(get(handles.edit2,'String'));
M = zeros(10,5);
b = M;
b(2, 1:3)=(1);
b(2:8,3)=(1);
b(8,:) = (1)
set(handles.edit5,'String',num2str(b));
pause (5)
set(handles.edit5,'String',num2str(M));
retro = a;
for i = 1 : a;
for j= 1:5
if retro == 0
break
end
retro = retro -1
M(i,j) = retro;
set(handles.edit5,'String',num2str(M));
pause(1)
M(i,j) = 1;
set(handles.edit5,'String',num2str(M));
pause(1)
home
end
end
c = str2double(get(handles.edit3,'String'));
M = zeros(10,5);
d= M;
d(2,:) = (1);
d(2:6,5) = (1);
d(6,:) = (1);
d(7:9,1) = (1);
d(9,:) = (1)
set(handles.edit5,'String',num2str(d))
pause (5);
set(handles.edit5,'String',num2str(d));
retro = c;
for i = 1 : c;
for j= 1:5
if retro == 0
break
end
retro = retro -1
M(i,j) = retro;
set(handles.edit5,'String',num2str(M));
pause(1)
M(i,j) = 1;
set(handles.edit5,'String',num2str(M));
pause(1)
home
end
end
e = str2double(get(handles.edit4,'String'));
M = zeros(10,5);
f = M;
f(2,:) = (1);
f(6, :) = (1);
f(9 ,:) = (1);
f(2:9,5) = (1)
set(handles.edit5,'String',num2str(f));
pause (5)
set(handles.edit5,'String',num2str(M));
retro = e;
for i = 1 : e;
for j= 1:5
if retro == 0
break
end
retro = retro -1
M(i,j) = retro;
set(handles.edit5,'String',num2str(M));
pause(1)
M(i,j) = 1;
set(handles.edit5,'String',num2str(M));
pause(1)
home
end
end
end
end
Mediante el proceso tomado se llega a una solucin propuesta con base en los
fundamentos y los conocimientos adquiridos durante el proceso de formacin para que
mediante la construccin de esta solucin individual nos apropiemos de la hiptesis y
propuesta metodologa dispuesta y definida por el grupo para contribuir activamente en
la ejecucin de la propuesta metodolgica y as aportar en la construccin de la
solucin del problema planteado en la consolidacin del informe que recopile de
manera sucinta la solucin al problema planteado.
BIBLIOGRAFIA