function varargout = c2f(varargin) % C2F M-file for c2f.fig % C2F, by itself, creates a new C2F or raises the existing % singleton*. % % H = C2F returns the handle to a new C2F or the handle to % the existing singleton*. % % C2F('CALLBACK',hObject,eventData,handles,...) calls the local % function named CALLBACK in C2F.M with the given input arguments. % % C2F('Property','Value',...) creates a new C2F or raises the % existing singleton*. Starting from the left, property value pairs are % applied to the GUI before c2f_OpeningFunction gets called. An % unrecognized property name or invalid value makes property application % stop. All inputs are passed to c2f_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 c2f % Last Modified by GUIDE v2.5 08-May-2008 23:14:34 % Begin initialization code - DO NOT EDIT gui_Singleton = 1; gui_State = struct('gui_Name', mfilename, ... 'gui_Singleton', gui_Singleton, ... 'gui_OpeningFcn', @c2f_OpeningFcn, ... 'gui_OutputFcn', @c2f_OutputFcn, ... 'gui_LayoutFcn', [] , ... 'gui_Callback', []); if nargin & isstr(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 c2f is made visible. function c2f_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 c2f (see VARARGIN) % Choose default command line output for c2f handles.output = hObject; % Update handles structure guidata(hObject, handles); % UIWAIT makes c2f wait for user response (see UIRESUME) % uiwait(handles.figure1); % --- Outputs from this function are returned to the command line. function varargout = c2f_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 button press in cel2fah. function cel2fah_Callback(hObject, eventdata, handles) % hObject handle to cel2fah (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) cel=get(handles.bathmoi,'String') fah=(str2num(cel)*1.8)+32 set(handles.out,'String',num2str(fah)) % --- Executes on button press in fah2cel. function fah2cel_Callback(hObject, eventdata, handles) % hObject handle to fah2cel (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) fah=get(handles.bathmoi,'String') cel=(str2num(fah)-32)/1.8 set(handles.out,'String',num2str(cel)) % --- Executes during object creation, after setting all properties. function bathmoi_CreateFcn(hObject, eventdata, handles) % hObject handle to bathmoi (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 bathmoi_Callback(hObject, eventdata, handles) % hObject handle to bathmoi (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 bathmoi as text % str2double(get(hObject,'String')) returns contents of bathmoi as a double % --- Executes during object creation, after setting all properties. function out_CreateFcn(hObject, eventdata, handles) % hObject handle to out (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 out_Callback(hObject, eventdata, handles) % hObject handle to out (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 out as text % str2double(get(hObject,'String')) returns contents of out as a double