You are on page 1of 5

function varargout = termok(varargin)

% TERMOK MATLAB code for termok.fig


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

% Last Modified by GUIDE v2.5 25-Nov-2018 01:36:38

% Begin initialization code - DO NOT EDIT


gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @termok_OpeningFcn, ...
'gui_OutputFcn', @termok_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

1
% --- Executes just before termok is made visible.
function termok_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 termok (see VARARGIN)

% Choose default command line output for termok


handles.output = hObject;

% Update handles structure


guidata(hObject, handles);

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


% uiwait(handles.figure1);

% --- Outputs from this function are returned to the command line.
function varargout = termok_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;

function entradav_Callback(hObject, eventdata, handles)


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


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

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


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

2
% --- Executes on button press in pushbutton2.
function pushbutton2_Callback(hObject, eventdata, handles)

% Coeficientes d para un cammpo de medida de -210 a 0 °C.


D=[0.0000000E+00 1.9528268E+01 -1.2286185E+00 -1.0752178E+00
-5.9086933E-01 -1.7256713E-01 -2.8131513E-02 -2.3963370E-03
-8.3823321E-05];
% Coeficientes d para un cammpo de medida de 0 a 760 °C.
D1=[0.000000E+00 1.978425E+01 -2.001204E-01 1.036969E-02 -2.549687E-04
3.585153E-06 -5.344285E-08 5.099890E-10 0.000000E+00];
% Coeficientes d para un cammpo de medida de 760 a 1200 °C.
D2=[-3.11358187E+03 3.00543684E+02 -9.94773230E+00 1.70276630E-01
-1.43033468E-03 4.73886084E-06 0 0 0];
t2=get(handles.entradav,'String');
v = str2double(t2);
C=[1;v;v^2;v^3;v^4;v^5;v^6;v^7;v^8;v^9];
if v >= (-8.095) && v < 0
tempe=D*C;
else
if v >= 0 && v < 42.919
tempe=D1*C;
end
if v >=42.919 && v <= 69.553
tempe=D2*C;
end
end

set(handles.temperatura,'String',tempe);

function entradat_Callback(hObject, eventdata, handles)


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


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

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


function entradat_CreateFcn(hObject, eventdata, handles)
% hObject handle to entradat (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'))

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

% --- Executes on button press in pushbutton1.


function pushbutton1_Callback(hObject, eventdata, handles)
% coeficientes para un cammpo de medida de -210 a 760 °C.
A=[0 0.503811878150e-1 0.304758369300e-4 -0.856810657200e-7
0.132281952950e-09 -0.170529583370e-12 0.209480906970e-15
-0.125383953360e-18 0.156317256970e-22];
% coeficientes para un cammpo de medida de 760 a 1200 °C.
A1=[0.296456256810E+03 -0.149761277860E+01 0.317871039240E-02
-0.31847686701E-05 0.157208190040E-08 -0.306913690560E-12]
% %valores exponenciales
% a0 = 0.118597600000E+00
% a1 = -0.118343200000E-03
% a2 = 0.126968600000E+03

t1=get(handles.entradat,'String');
t = str2double(t1)
B=[1;t;t^2;t^3;t^4;t^5;t^6;t^7;t^8]
B1=[1;t;t^2;t^3;t^4;t^5]
if t >= (-210) && t < 0
mv=A*B;
else t >= 0 && t <= 1200
mv=A1*B1;
end
set(handles.voltaje,'String',mv);

% --- Executes on button press in pushbutton4.


function pushbutton4_Callback(hObject, eventdata, handles)

set(handles.entradav,'String','');
set(handles.temperatura,'String','');

% --- Executes on button press in pushbutton3.


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

% --- Executes on button press in pushbutton5.


function pushbutton5_Callback(hObject, eventdata, handles)
set(handles.entradat,'String','');
set(handles.voltaje,'String','');

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


function axes1_CreateFcn(hObject, eventdata, handles)

a=imread ('espe.jpg');

4
image(a)
axis off

% Hint: place code in OpeningFcn to populate axes1

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


function axes2_CreateFcn(hObject, eventdata, handles)

a=imread ('meca.jpg');
image(a)
axis off

Published with MATLAB® R2017b

You might also like