Sie sind auf Seite 1von 7

TRABAJO ENCARGADO DE PROGRAMACION PAARA LA INGENIERIA

Nombres y apellidos: Frank, QUIÑONES PUMA


Escuela Profesional: Ingeniería en energías renovables
Semestre: VI
Ejercicio 1 % handles structure with
handles and user data (see
GUIDATA)
% --- Executes on button press
in pbborrar. % Hints: get(hObject,'String')
function returns contents of rp as text
pbborrar_Callback(hObject, %
eventdata, handles) str2double(get(hObject,'String
set(handles.li,'string',''); ')) returns contents of rp as
set(handles.ld,'string',''); a double
set(handles.fr,'string','')
set(handles.ta,'string','');
set(handles.m1,'string',''); % --- Executes during object
set(handles.m2,'string',''); creation, after setting all
set(handles.m3,'string',''); properties.
set(handles.rp,'string',''); function rp_CreateFcn(hObject,
function eventdata, handles)
sali_Callback(hObject, % hObject handle to rp (see
eventdata, handles) GCBO)
opc=questdlg('¿desea salir del % eventdata reserved - to be
programa?','salir','si','no',' defined in a future version of
no') MATLAB
if strcmp(opc,'no'); % handles empty - handles
return; not created until after all
end CreateFcns called
delete(ejercicio_1);
% Hint: edit controls usually
% --- Executes on button press have a white background on
in ver. Windows.
function ver_Callback(hObject, % See ISPC and COMPUTER.
eventdata, handles) if ispc &&
ti=str2num(get(handles.ld,'str isequal(get(hObject,'Backgroun
ing')); dColor'),
td=str2num(get(handles.li,'str get(0,'defaultUicontrolBackgro
ing')); undColor'))
k=str2num(get(handles.m2,'stri
ng')); set(hObject,'BackgroundColor',
e=str2num(get(handles.m3,'stri 'white');
ng')); end
[x,y]=meshgrid(-1:0.1:1);
z=((ti-td)/e)*x-y;
axes(handles.grafica);
pcolor(x,y,z),colorbar; % --- Executes when selected
object is changed in material.
function rp_Callback(hObject, function
eventdata, handles) material_SelectionChangedFcn(h
% hObject handle to rp (see Object, eventdata, handles)
GCBO) if hObject==handles.mad
% eventdata reserved - to be
defined in a future version of set(handles.m2,'string',0.12)
MATLAB elseif hObject==handles.vid

set(handles.m2,'string',0.8)
elseif hObject==handles.ladr % hObject handle to m1 (see
GCBO)
set(handles.m2,'string',0.15) % eventdata reserved - to be
elseif hObject==handles.lad defined in a future version of
MATLAB
set(handles.m2,'string',0.6) % handles empty - handles
elseif hObject==handles.am not created until after all
CreateFcns called
set(handles.m2,'string',0.04)
else hObject==handles.ac % Hint: edit controls usually
have a white background on
set(handles.m2,'string',46) Windows.
end % See ISPC and COMPUTER.
if ispc &&
% --- Executes when selected isequal(get(hObject,'Backgroun
object is changed in medio. dColor'),
function get(0,'defaultUicontrolBackgro
medio_SelectionChangedFcn(hObj undColor'))
ect, eventdata, handles)
if hObject==handles.aire set(hObject,'BackgroundColor',
'white');
set(handles.m1,'string',25) end
elseif
hObject==handles.vaporso

set(handles.m1,'string',300)
elseif hObject==handles.agua function m3_Callback(hObject,
eventdata, handles)
set(handles.m1,'string',6000) % hObject handle to m3 (see
else hObject==handles.vaporcon GCBO)
% eventdata reserved - to be
set(handles.m1,'string',3000) defined in a future version of
end MATLAB
% handles structure with
handles and user data (see
GUIDATA)
function m1_Callback(hObject,
eventdata, handles) % Hints: get(hObject,'String')
% hObject handle to m1 (see returns contents of m3 as text
GCBO) %
% eventdata reserved - to be str2double(get(hObject,'String
defined in a future version of ')) returns contents of m3 as
MATLAB a double
% handles structure with
handles and user data (see
GUIDATA)
% --- Executes during object
% Hints: get(hObject,'String') creation, after setting all
returns contents of m1 as text properties.
% function m3_CreateFcn(hObject,
str2double(get(hObject,'String eventdata, handles)
')) returns contents of m1 as % hObject handle to m3 (see
a double GCBO)
% eventdata reserved - to be
defined in a future version of
MATLAB
% --- Executes during object % handles empty - handles
creation, after setting all not created until after all
properties. CreateFcns called
function m1_CreateFcn(hObject,
eventdata, handles)
% Hint: edit controls usually get(0,'defaultUicontrolBackgro
have a white background on undColor'))
Windows.
% See ISPC and COMPUTER. set(hObject,'BackgroundColor',
if ispc && 'white');
isequal(get(hObject,'Backgroun end
dColor'),
get(0,'defaultUicontrolBackgro
undColor'))

set(hObject,'BackgroundColor', function
'white'); edit25_Callback(hObject,
end eventdata, handles)
% hObject handle to edit25
(see GCBO)
% eventdata reserved - to be
defined in a future version of
function MATLAB
edit24_Callback(hObject, % handles structure with
eventdata, handles) handles and user data (see
% hObject handle to edit24 GUIDATA)
(see GCBO)
% eventdata reserved - to be % Hints: get(hObject,'String')
defined in a future version of returns contents of edit25 as
MATLAB text
% handles structure with %
handles and user data (see str2double(get(hObject,'String
GUIDATA) ')) returns contents of edit25
as a double
% Hints: get(hObject,'String')
returns contents of edit24 as
text % --- Executes during object
% creation, after setting all
str2double(get(hObject,'String properties.
')) returns contents of edit24 function
as a double edit25_CreateFcn(hObject,
eventdata, handles)
% hObject handle to edit25
% --- Executes during object (see GCBO)
creation, after setting all % eventdata reserved - to be
properties. defined in a future version of
function MATLAB
edit24_CreateFcn(hObject, % handles empty - handles
eventdata, handles) not created until after all
% hObject handle to edit24 CreateFcns called
(see GCBO)
% eventdata reserved - to be % Hint: edit controls usually
defined in a future version of have a white background on
MATLAB Windows.
% handles empty - handles % See ISPC and COMPUTER.
not created until after all if ispc &&
CreateFcns called isequal(get(hObject,'Backgroun
dColor'),
% Hint: edit controls usually get(0,'defaultUicontrolBackgro
have a white background on undColor'))
Windows.
% See ISPC and COMPUTER. set(hObject,'BackgroundColor',
if ispc && 'white');
isequal(get(hObject,'Backgroun end
dColor'),
% handles structure with
function handles and user data (see
edit26_Callback(hObject, GUIDATA)
eventdata, handles)
% hObject handle to edit26 % Hints: get(hObject,'String')
(see GCBO) returns contents of m2 as text
% eventdata reserved - to be %
defined in a future version of str2double(get(hObject,'String
MATLAB ')) returns contents of m2 as
% handles structure with a double
handles and user data (see
GUIDATA)
% --- Executes during object
% Hints: get(hObject,'String') creation, after setting all
returns contents of edit26 as properties.
text function m2_CreateFcn(hObject,
% eventdata, handles)
str2double(get(hObject,'String % hObject handle to m2 (see
')) returns contents of edit26 GCBO)
as a double % eventdata reserved - to be
defined in a future version of
MATLAB
% --- Executes during object % handles empty - handles
creation, after setting all not created until after all
properties. CreateFcns called
function
edit26_CreateFcn(hObject, % Hint: edit controls usually
eventdata, handles) have a white background on
% hObject handle to edit26 Windows.
(see GCBO) % See ISPC and COMPUTER.
% eventdata reserved - to be if ispc &&
defined in a future version of isequal(get(hObject,'Backgroun
MATLAB dColor'),
% handles empty - handles get(0,'defaultUicontrolBackgro
not created until after all undColor'))
CreateFcns called
set(hObject,'BackgroundColor',
% Hint: edit controls usually 'white');
have a white background on end
Windows.
% See ISPC and COMPUTER.
if ispc && % --- Executes on button press
isequal(get(hObject,'Backgroun in resolver.
dColor'), function
get(0,'defaultUicontrolBackgro resolver_Callback(hObject,
undColor')) eventdata, handles)
i=str2num(get(handles.li,'stri
set(hObject,'BackgroundColor', ng'));
'white'); f=str2num(get(handles.ld,'stri
end ng'));
k=str2num(get(handles.m2,'stri
ng'));
e=str2num(get(handles.m3,'stri
function m2_Callback(hObject, ng'));
eventdata, handles) Q=k*(i-f)*e;
% hObject handle to m2 (see set(handles.rp,'string',Q)
GCBO)
% eventdata reserved - to be
defined in a future version of
MATLAB
Ejercicio 2 gui_State.gui_Callback =
str2func(varargin{1});
function varargout = end
ejercicio_2(varargin)
% EJERCICIO_2 M-file for ejercicio_2.fig if nargout
% EJERCICIO_2, by itself, creates a [varargout{1:nargout}] =
new EJERCICIO_2 or raises the existing gui_mainfcn(gui_State, varargin{:});
% singleton*. else
% gui_mainfcn(gui_State, varargin{:});
% H = EJERCICIO_2 returns the end
handle to a new EJERCICIO_2 or the % End initialization code - DO NOT EDIT
handle to
% the existing singleton*.
%
% % --- Executes just before ejercicio_2
EJERCICIO_2('CALLBACK',hObject,eventData is made visible.
,handles,...) calls the local function ejercicio_2_OpeningFcn(hObject,
% function named CALLBACK in eventdata, handles, varargin)
EJERCICIO_2.M with the given input % This function has no output args, see
arguments. OutputFcn.
% % hObject handle to figure
% % eventdata reserved - to be defined in
EJERCICIO_2('Property','Value',...) a future version of MATLAB
creates a new EJERCICIO_2 or raises the % handles structure with handles and
% existing singleton*. Starting user data (see GUIDATA)
from the left, property value pairs are % varargin command line arguments to
% applied to the GUI before ejercicio_2 (see VARARGIN)
ejercicio_2_OpeningFcn gets called. An
% unrecognized property name or % Choose default command line output for
invalid value makes property application ejercicio_2
% stop. All inputs are passed to handles.output = hObject;
ejercicio_2_OpeningFcn via varargin.
% % Update handles structure
% *See GUI Options on GUIDE's Tools guidata(hObject, handles);
menu. Choose "GUI allows only one
% instance to run (singleton)". % UIWAIT makes ejercicio_2 wait for user
% response (see UIRESUME)
% See also: GUIDE, GUIDATA, GUIHANDLES % uiwait(handles.figure1);

% Edit the above text to modify the


response to help ejercicio_2 % --- Outputs from this function are
returned to the command line.
% Last Modified by GUIDE v2.5 21-Jul- function varargout =
2017 14:03:42 ejercicio_2_OutputFcn(hObject,
eventdata, handles)
% Begin initialization code - DO NOT % varargout cell array for returning
EDIT output args (see VARARGOUT);
gui_Singleton = 1; % hObject handle to figure
gui_State = struct('gui_Name', % eventdata reserved - to be defined in
mfilename, ... a future version of MATLAB
'gui_Singleton', % handles structure with handles and
gui_Singleton, ... user data (see GUIDATA)
'gui_OpeningFcn',
@ejercicio_2_OpeningFcn, ... % Get default command line output from
'gui_OutputFcn', handles structure
@ejercicio_2_OutputFcn, ... varargout{1} = handles.output;
'gui_LayoutFcn', []
, ...
'gui_Callback',
[]); % --- Executes on button press in
if nargin && ischar(varargin{1}) cargar.
function cargar_Callback(hObject, delete(ejercicio_2);
eventdata, handles)
a=xlsread('potencial eolico.xlsx'),
datos=[a]; % --- Executes when entered data in
set(handles.tabla,'data',datos); editable cell(s) in tabla.
% --- Executes on button press in function tabla_CellEditCallback(hObject,
procesar. eventdata, handles)
function procesar_Callback(hObject, % hObject handle to tabla (see GCBO)
eventdata, handles) % eventdata structure with the
a=xlsread('potencial eolico.xlsx'), following fields (see
dato=[a]; MATLAB.UI.CONTROL.TABLE)
axes(handles.grafica); % Indices: row and column indices of
pie(a),legend('30-35','25-30','20- the cell(s) edited
25','15-20','10-15','5-10','0-5'); % PreviousData: previous data for the
% --- Executes on button press in nuevo. cell(s) edited
function nuevo_Callback(hObject, % EditData: string(s) entered by the
eventdata, handles) user
% NewData: EditData or its converted
% --- Executes on button press in salir. form set on the Data property. Empty if
function salir_Callback(hObject, Data was not changed
eventdata, handles) % Error: error string when failed to
opc=questdlg('¿desea salir del convert EditData to appropriate value
programa?','salir','si','no','no') for Data
if strcmp(opc,'no'); % handles structure with handles and
return; user data (see GUIDATA)
end

Ejercicio 2

Das könnte Ihnen auch gefallen