Sie sind auf Seite 1von 12

function varargout = ProgramaJO(varargin)

% PROGRAMAJO M-file for ProgramaJO.fig


%
PROGRAMAJO, by itself, creates a new PROGRAMAJO or raises the existing
%
singleton*.
%
%
H = PROGRAMAJO returns the handle to a new PROGRAMAJO or the handle to
%
the existing singleton*.
%
%
PROGRAMAJO('CALLBACK',hObject,eventData,handles,...) calls the local
%
function named CALLBACK in PROGRAMAJO.M with the given input arguments.
%
%
PROGRAMAJO('Property','Value',...) creates a new PROGRAMAJO or raises the
%
existing singleton*. Starting from the left, property value pairs are
%
applied to the GUI before ProgramaJO_OpeningFunction gets called. An
%
unrecognized property name or invalid value makes property application
%
stop. All inputs are passed to ProgramaJO_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 ProgramaJO
% Last Modified by GUIDE v2.5 27-May-2016 14:41:15
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',
mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @ProgramaJO_OpeningFcn, ...
'gui_OutputFcn', @ProgramaJO_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 ProgramaJO is made visible.
function ProgramaJO_OpeningFcn(hObject, eventdata, handles, varargin)
if strcmp(get(hObject,'Visible'),'off')
logo = 'civil1'; axes(handles.axes1);
handles.imagen=imread('civil1','bmp');
imagesc(handles.imagen);
axis off;
logo = 'flujo'; axes(handles.axes2);
handles.imagen=imread('flujo','bmp');
imagesc(handles.imagen);
axis off;
end

%
%
%
%
%

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 ProgramaJO (see VARARGIN)

% Choose default command line output for ProgramaJO


handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes ProgramaJO wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = ProgramaJO_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 when user attempts to close figure1.
function figure1_CloseRequestFcn(hObject, eventdata, handles)
opc=questdlg('Desea salir del programa?',...
'SALIR','Si','No','No');
if strcmp(opc,'No')
return;
end
delete(hObject);
% hObject
handle to figure1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
% Hint: delete(hObject) closes the figure

% --- 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 = get(hObject,'String') returns popupmenu1 contents as cell ar
ray
%
contents{get(hObject,'Value')} returns selected item from popupmenu1
% --- 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
set(hObject,'BackgroundColor','white');
else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
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 = get(hObject,'String') returns popupmenu2 contents as cell ar
ray
%
contents{get(hObject,'Value')} returns selected item from popupmenu2
% --- 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
set(hObject,'BackgroundColor','white');
else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end

function edit1_Callback(hObject, eventdata, handles)


% hObject
handle to edit1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit1 as text
%
str2double(get(hObject,'String')) returns contents of edit1 as a double
% --- Executes during object creation, after setting all properties.
function edit1_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
%
See ISPC and COMPUTER.
if ispc
set(hObject,'BackgroundColor','white');
else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end

function edit2_Callback(hObject, eventdata, handles)


% hObject
handle to edit2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit2 as text
%
str2double(get(hObject,'String')) returns contents of edit2 as a double
% --- Executes during object creation, after setting all properties.
function edit2_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
%
See ISPC and COMPUTER.
if ispc
set(hObject,'BackgroundColor','white');
else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end
% --- Executes on button press in pushbutton1.
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject
handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
d=str2double(get(handles.edit3,'string')); %Dimetro en pulgadas
dc=(d*2.54)/100; %Dimetro en centmetros
A=(pi.*(dc^2))/4; %Clculo del rea
q=str2double(get(handles.edit1,'string')); %Caudal en litros por segundo
qm=q/1000;
%Caudal en metros cbicos por segundo
V=qm./A;
%Clculo de la velocidad del caudal
set(handles.text13,'String',num2str(V));
l=str2double(get(handles.edit2,'string')); %Longitud del tramo en metros
t=str2double(get(handles.edit17,'string')); %Temperatura en grados centgrados
%Condiciones para el clculo de la velocidad cinemtica (m2/s)
if(t<5)
return;
else
if(t>65)
return;
end
end
if (5<=t<10)
Yx= 1.520 + (((t-5).*(1.308-1.520))/5);
vc=Yx.*(10^-6);
Re=(V*dc)./vc; %Clculo de Nmero de Reynolds
set(handles.text14,'String',num2str(Re));
else
if (10<=t<15)
Yx1= 1.308 + (((t-10).*(1.142-1.308))/5);
vc1=Yx1.*(10^-6);
Re1=(V*dc)./vc1;
set(handles.text14,'String',num2str(Re1));
else
if (15<=t<20)

Yx2= 1.142 + (((t-15).*(1.007-1.142))/5);


vc2=Yx2.*(10^-6);
Re2=(V*dc)./vc2;
set(handles.text14,'String',num2str(Re2));
else
if (20<=t<25)
Yx3= 1.007 + (((t-20).*(0.897-1.007))/5);
vc3=Yx3.*(10^-6);
Re3=(V*dc)./vc3;
set(handles.text14,'String',num2str(Re3))
else
if (25<=t<30)
Yx4= 0.897 + (((t-25).*(0.804-0.897))./5);
vc4=Yx4.*(10^-6);
Re4=(V*dc)./vc4;
set(handles.text14,'String',num2str(Re4));
else
if (30<=t<35)
Yx5= 0.804 + (((t-30).*(0.727-0.804))/5);
vc5=Yx5.*(10^-6);
Re5=(V*dc)./vc5;
set(handles.text14,'String',num2str(Re5));
else
if (35<=t<40)
Yx6= 0.727 + (((t-35).*(0.661-0.727))/5);
vc6=Yx6.*(10^-6);
Re6=(V*dc)./vc6;
set(handles.text14,'String',num2str(Re6));
else
if (40<=t<50)
Yx7= 0.661 + (((t-40).*(0.556-0.661))/5);
vc7=Yx7.*(10^-6);
Re7=(V*dc)./vc7;
set(handles.text14,'String',num2str(Re7));
else
if (50<=t<65)
Yx8= 0.556 + (((t-50).*(0.442-0.556))/5);
vc8=Yx8.*(10^-6);
Re8=(V*dc)./vc8;
set(handles.text14,'String',num2str(Re8));
end
end
end
end
end
end
end
end
end
%Condiciones flujo turbulento o flujo laminar
if Re<=2000
ms='Flujo laminar';
set(handles.text40,'String',num2str(ms));
end
if Re>=10000
ms='Flujo turbulento';
set(handles.text40,'String',num2str(ms));
end

set(handles.text41,'Visible','on');
set(handles.text9,'Visible','on');
set(handles.text20,'Visible','on');
set(handles.text12,'Visible','on');
set(handles.text13,'Visible','on');
set(handles.text14,'Visible','on');
set(handles.text40,'Visible','on');
set(handles.text15,'Visible','on');
set(handles.text16,'Visible','on');
function edit3_Callback(hObject, eventdata, handles)
% hObject
handle to edit3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit3 as text
%
str2double(get(hObject,'String')) returns contents of edit3 as a double
% --- Executes during object creation, after setting all properties.
function edit3_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
%
See ISPC and COMPUTER.
if ispc
set(hObject,'BackgroundColor','white');
else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end

function edit4_Callback(hObject, eventdata, handles)


% hObject
handle to edit4 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit4 as text
%
str2double(get(hObject,'String')) returns contents of edit4 as a double
% --- Executes during object creation, after setting all properties.
function edit4_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit4 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
%
See ISPC and COMPUTER.
if ispc
set(hObject,'BackgroundColor','white');
else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end

function edit5_Callback(hObject, eventdata, handles)


% hObject
handle to edit5 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit5 as text
%
str2double(get(hObject,'String')) returns contents of edit5 as a double
% --- Executes during object creation, after setting all properties.
function edit5_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit5 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
%
See ISPC and COMPUTER.
if ispc
set(hObject,'BackgroundColor','white');
else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end

function edit8_Callback(hObject, eventdata, handles)


% hObject
handle to edit8 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit8 as text
%
str2double(get(hObject,'String')) returns contents of edit8 as a double
% --- Executes during object creation, after setting all properties.
function edit8_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit8 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
%
See ISPC and COMPUTER.
if ispc
set(hObject,'BackgroundColor','white');
else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end

function edit9_Callback(hObject, eventdata, handles)


% hObject
handle to edit9 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit9 as text
%
str2double(get(hObject,'String')) returns contents of edit9 as a double

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


function edit9_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit9 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
%
See ISPC and COMPUTER.
if ispc
set(hObject,'BackgroundColor','white');
else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end

function edit10_Callback(hObject, eventdata, handles)


% hObject
handle to edit10 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit10 as text
%
str2double(get(hObject,'String')) returns contents of edit10 as a doubl
e
% --- Executes during object creation, after setting all properties.
function edit10_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit10 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
%
See ISPC and COMPUTER.
if ispc
set(hObject,'BackgroundColor','white');
else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end

function edit11_Callback(hObject, eventdata, handles)


% hObject
handle to edit11 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit11 as text
%
str2double(get(hObject,'String')) returns contents of edit11 as a doubl
e
% --- Executes during object creation, after setting all properties.
function edit11_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit11 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.

%
See ISPC and COMPUTER.
if ispc
set(hObject,'BackgroundColor','white');
else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end

function edit12_Callback(hObject, eventdata, handles)


% hObject
handle to edit12 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit12 as text
%
str2double(get(hObject,'String')) returns contents of edit12 as a doubl
e
% --- Executes during object creation, after setting all properties.
function edit12_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit12 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
%
See ISPC and COMPUTER.
if ispc
set(hObject,'BackgroundColor','white');
else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end

function edit13_Callback(hObject, eventdata, handles)


% hObject
handle to edit13 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit13 as text
%
str2double(get(hObject,'String')) returns contents of edit13 as a doubl
e
% --- Executes during object creation, after setting all properties.
function edit13_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit13 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
%
See ISPC and COMPUTER.
if ispc
set(hObject,'BackgroundColor','white');
else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end

function edit14_Callback(hObject, eventdata, handles)


% hObject
handle to edit14 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit14 as text
%
str2double(get(hObject,'String')) returns contents of edit14 as a doubl
e
% --- Executes during object creation, after setting all properties.
function edit14_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit14 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
%
See ISPC and COMPUTER.
if ispc
set(hObject,'BackgroundColor','white');
else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end

function edit15_Callback(hObject, eventdata, handles)


% hObject
handle to edit15 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit15 as text
%
str2double(get(hObject,'String')) returns contents of edit15 as a doubl
e
% --- Executes during object creation, after setting all properties.
function edit15_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit15 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
%
See ISPC and COMPUTER.
if ispc
set(hObject,'BackgroundColor','white');
else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end

function edit16_Callback(hObject, eventdata, handles)


% hObject
handle to edit16 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit16 as text
%
str2double(get(hObject,'String')) returns contents of edit16 as a doubl

e
% --- Executes during object creation, after setting all properties.
function edit16_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit16 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
%
See ISPC and COMPUTER.
if ispc
set(hObject,'BackgroundColor','white');
else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end

%
%
%
%

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


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

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


function text2_CreateFcn(hObject, eventdata, handles)
% hObject
handle to text2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
empty - handles not created until after all CreateFcns called
% --- Executes on button press in pushbutton2.
function pushbutton2_Callback(hObject, eventdata, handles)
% hObject
handle to pushbutton2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)

function edit17_Callback(hObject, eventdata, handles)


% hObject
handle to edit17 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit17 as text
%
str2double(get(hObject,'String')) returns contents of edit17 as a doubl
e
% --- Executes during object creation, after setting all properties.
function edit17_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit17 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.


%
See ISPC and COMPUTER.
if ispc
set(hObject,'BackgroundColor','white');
else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end

Das könnte Ihnen auch gefallen