Welcome to Scribd. Sign in or start your free trial to enjoy unlimited e-books, audiobooks & documents.Find out more
Download
Standard view
Full view
of .
Look up keyword
Like this
1Activity
0 of .
Results for:
No results containing your search query
P. 1
Temperature Conversion Calculator

Temperature Conversion Calculator

Ratings: (0)|Views: 34|Likes:
Published by Jans Hendry

More info:

Published by: Jans Hendry on Nov 06, 2012
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF or read online from Scribd
See more
See less

07/05/2013

pdf

 
[matlab]
2012
[janshendry@gmail.com]
 
TEMPERATURE CONVERSION CALCULATOR
Saya tampilkan konvertor suhu yang terdiri atas 8 jenis:Codenya adalah
functionvarargout = tempCalc(varargin)
 
% TEMPCALC M-file for tempCalc.fig
 
% TEMPCALC, by itself, creates a new TEMPCALC or raises the existing
 
% singleton*.
 
%
 
% H = TEMPCALC returns the handle to a new TEMPCALC or the handle to
 
% the existing singleton*.
 
%
 
% TEMPCALC('CALLBACK',hObject,eventData,handles,...) calls the local
 
% function named CALLBACK in TEMPCALC.M with the given input arguments.
 
%
 
% TEMPCALC('Property','Value',...) creates a new TEMPCALC or raises the
 
% existing singleton*. Starting from the left, property value pairs are
 
% applied to the GUI before tempCalc_OpeningFcn gets called. An
 
% unrecognized property name or invalid value makes property application
 
% stop. All inputs are passed to tempCalc_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
 
 
[matlab]
2012
[janshendry@gmail.com]
 
% Edit the above text to modify the response to help tempCalc
 
% Last Modified by GUIDE v2.5 06-Nov-2012 15:54:31
 
% Begin initialization code - DO NOT EDIT
 
gui_Singleton = 1;
 
gui_State = struct('gui_Name', mfilename,...
 
'gui_Singleton', gui_Singleton,...
 
'gui_OpeningFcn', @tempCalc_OpeningFcn,...
 
'gui_OutputFcn', @tempCalc_OutputFcn,...
 
'gui_LayoutFcn', [] ,...
 
'gui_Callback', []);
 
ifnargin && ischar(varargin{1})
 
gui_State.gui_Callback = str2func(varargin{1});
 
end
 
ifnargout
 
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
 
else
 
gui_mainfcn(gui_State, varargin{:});
 
end
 
% End initialization code - DO NOT EDIT
 
% --- Executes just before tempCalc is made visible.
 
functiontempCalc_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 tempCalc (see VARARGIN)
 
% Choose default command line output for tempCalc
 
handles.output = hObject;
 
% Update handles structure
 
guidata(hObject, handles);
 
% UIWAIT makes tempCalc wait for user response (see UIRESUME)
 
% uiwait(handles.figure1);
 
% --- Outputs from this function are returned to the command line.
 
functionvarargout = tempCalc_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;
 
 
[matlab]
2012
[janshendry@gmail.com]
 
% --- Executes on slider movement.
 
functionslider1_Callback(hObject, eventdata, handles)
 
% hObject handle to slider1 (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,'Value') returns position of slider
 
% get(hObject,'Min') and get(hObject,'Max') to determine range ofslider
 
C = get(hObject,'value');
 
set(handles.edit1,'string', num2str(C));
 
[F, K, R, Ra, D, N, Ro] = CtoAll(C);
 
set(handles.slider2,'value', F);
 
set(handles.edit2,'string', num2str(F));
 
set(handles.slider3,'value', K);
 
set(handles.edit3,'string', num2str(K));
 
set(handles.slider4,'value', R);
 
set(handles.edit4,'string', num2str(R));
 
set(handles.slider5,'value', Ra);
 
set(handles.edit5,'string', num2str(Ra));
 
set(handles.slider6,'value', D);
 
set(handles.edit6,'string', num2str(D));
 
set(handles.slider7,'value', N);
 
set(handles.edit7,'string', num2str(N));
 
set(handles.slider8,'value', Ro);
 
set(handles.edit8,'string', num2str(Ro));
 
function[F, K, R, Ra, D, N, Ro] = CtoAll(C)
 
F = C * (9/5) + 32;
 
K = C + 273.15;
 
R = C * (4/5);
 
Ra = (C + 273.15) * (9/5);% K * (9/5)
 
D = (100 - C) * (3/2);
 
N = C * (33/100);
 
Ro = (C * (21/40)) + 7.5;
 
% --- Executes during object creation, after setting all properties.
 
functionslider1_CreateFcn(hObject, eventdata, handles)
 
% hObject handle to slider1 (see GCBO)
 
% eventdata reserved - to be defined in a future version of MATLAB
 
% handles empty - handles not created until after all CreateFcns called
 
% Hint: slider controls usually have a light gray background.
 
ifisequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
 
set(hObject,'BackgroundColor',[.9 .9 .9]);
 
end
 
% --- Executes on slider movement.
 

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->