image thumbnail

Calculating standard fire temperature (ISO834)

by

 

This tool calculates and plots standarf fire temperature

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

% Last Modified by GUIDE v2.5 05-Apr-2013 14:36:43

% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
                   'gui_Singleton',  gui_Singleton, ...
                   'gui_OpeningFcn', @STF_OpeningFcn, ...
                   'gui_OutputFcn',  @STF_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 STF is made visible.
function STF_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 STF (see VARARGIN)

% Choose default command line output for STF
handles.output = hObject;

% Update handles structure
guidata(hObject, handles);

% UIWAIT makes STF wait for user response (see UIRESUME)
% uiwait(handles.figure1);


% --- Outputs from this function are returned to the command line.
function varargout = STF_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 Timefinal_Callback(hObject, eventdata, handles)
% hObject    handle to Timefinal (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 Timefinal as text
%        str2double(get(hObject,'String')) returns contents of Timefinal as a double


% --- Executes during object creation, after setting all properties.
function Timefinal_CreateFcn(hObject, eventdata, handles)
% hObject    handle to Timefinal (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





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 && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end



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 && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


% --- Executes on button press in Calculate.
function Calculate_Callback(hObject, eventdata, handles)
% hObject    handle to Calculate (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
t_input=get(handles.Timefinal,'String');
tt_input=str2num(t_input);
tbein_input=get(handles.edit3,'String');
ttbein_input=str2num(tbein_input);
%now they converted to numbers. other calculation can be done after this
tf=tt_input;
t=(0:ttbein_input/60:tf)';
[a b]=size(t);
for c=1:1:a;
    T_f(c,:)=20+345*log10(8*t(c,:)+1);
end
%display(t);
%display(T_f);
plot(t,T_f,'parent',handles.axes1);
xlabel(handles.axes1,'Time (min)','fontsize',12);
ylabel(handles.axes1,'Temperature (\circ)','fontsize',12);

% creating matrix in gui
dat = [t*60,t,T_f]; 
cnames = {'Time (sec)','Time (min)','Temperature'};
a = uitable('Parent',STF,'Data',dat,'ColumnName',cnames,'Position',[480 50 292 253]);

Contact us