image thumbnail

Thermal Processing of Foods - GUI

by

 

a GUI to calculate a thermal process, using variable thermal properties (Choi Okos)

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

% Last Modified by GUIDE v2.5 11-Jan-2012 19:56:04

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

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

% Update handles structure
guidata(hObject, handles);

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


% --- Outputs from this function are returned to the command line.
function varargout = Thermal_Processing_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 selection change in pop_menu_can_size.
function [SI_can_internal_diameter,SI_can_height]=pop_menu_can_size_Callback(hObject, eventdata, handles)
% hObject    handle to pop_menu_can_size (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: contents = cellstr(get(hObject,'String')) returns pop_menu_can_size contents as cell array
%        contents{get(hObject,'Value')} returns selected item from pop_menu_can_size

can_size_case_number = get(handles.pop_menu_can_size,'Value');
if can_size_case_number == 72
    custom_can_size
    uiwait
    global custom_internal_diameter custom_can_height
    set(handles.internal_diameter,'String',custom_internal_diameter);
    set(handles.height,'String',custom_can_height);
    SI_can_internal_diameter = custom_internal_diameter/1000;
    SI_can_height = custom_can_height/1000;
else
    [can_internal_diameter,can_height] = switch_case_can_size(can_size_case_number);
    set(handles.internal_diameter,'String',can_internal_diameter);
    set(handles.height,'String',can_height);
    SI_can_internal_diameter = can_internal_diameter/1000;
    SI_can_height = can_height/1000;
end

% --- Executes during object creation, after setting all properties.
function pop_menu_can_size_CreateFcn(hObject, eventdata, handles)
% hObject    handle to pop_menu_can_size (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: popupmenu 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 edit1_Callback(hObject, eventdata, handles)
% hObject    handle to edit1 (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 edit1 as text
%        str2double(get(hObject,'String')) returns contents of edit1 as a double


% --- Executes during object creation, after setting all properties.
function edit1_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit1 (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 protein_Callback(hObject, eventdata, handles)
% hObject    handle to protein (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 protein as text
%        str2double(get(hObject,'String')) returns contents of protein as a double


% --- Executes during object creation, after setting all properties.
function protein_CreateFcn(hObject, eventdata, handles)
% hObject    handle to protein (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 fat_Callback(hObject, eventdata, handles)
% hObject    handle to fat (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 fat as text
%        str2double(get(hObject,'String')) returns contents of fat as a double


% --- Executes during object creation, after setting all properties.
function fat_CreateFcn(hObject, eventdata, handles)
% hObject    handle to fat (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 carbh_Callback(hObject, eventdata, handles)
% hObject    handle to carbh (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 carbh as text
%        str2double(get(hObject,'String')) returns contents of carbh as a double


% --- Executes during object creation, after setting all properties.
function carbh_CreateFcn(hObject, eventdata, handles)
% hObject    handle to carbh (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 fiber_Callback(hObject, eventdata, handles)
% hObject    handle to fiber (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 fiber as text
%        str2double(get(hObject,'String')) returns contents of fiber as a double


% --- Executes during object creation, after setting all properties.
function fiber_CreateFcn(hObject, eventdata, handles)
% hObject    handle to fiber (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 ash_Callback(hObject, eventdata, handles)
% hObject    handle to ash (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 ash as text
%        str2double(get(hObject,'String')) returns contents of ash as a double


% --- Executes during object creation, after setting all properties.
function ash_CreateFcn(hObject, eventdata, handles)
% hObject    handle to ash (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 water_Callback(hObject, eventdata, handles)
% hObject    handle to water (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 water as text
%        str2double(get(hObject,'String')) returns contents of water as a double


% --- Executes during object creation, after setting all properties.
function water_CreateFcn(hObject, eventdata, handles)
% hObject    handle to water (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 process_calculation.
function process_calculation_Callback(hObject, eventdata, handles)
% hObject    handle to process_calculation (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
% =========================================================================
can_internal_diameter = str2double(get(handles.internal_diameter,'String'));
can_height = str2double(get(handles.height,'String'));
    SI_can_internal_diameter = can_internal_diameter/1000;
    SI_can_height = can_height/1000;
%
food_protein = str2double(get(handles.protein,'String'));
food_fat = str2double(get(handles.fat,'String'));
food_carbh = str2double(get(handles.carbh,'String'));
food_fiber = str2double(get(handles.fiber,'String'));
food_ash = str2double(get(handles.ash,'String'));
food_water = str2double(get(handles.water,'String'));
% =========================================================================
if food_protein<0 || isnan(food_protein) || food_protein > 100
    errordlg('Protein - Outside Range','ERROR')
    return
end
if food_fat<0 || isnan(food_fat) || food_fat > 100
    errordlg('Fat - Outside Range','ERROR')
    return
end
if food_carbh<0 || isnan(food_carbh) || food_carbh > 100
    errordlg('Carbh - Outside Range','ERROR')
    return
end
if food_fiber<0 || isnan(food_fiber) || food_fiber > 100
    errordlg('Fiber - Outside Range','ERROR')
    return
end
if food_ash<0 || isnan(food_ash) || food_ash > 100
    errordlg('Ash - Outside Range','ERROR')
    return
end
if food_water<0 || isnan(food_water) || food_water > 100
    errordlg('Water - Outside Range','ERROR')
    return
end
% =========================================================================
Test_Food_composition = food_water + food_ash + food_fiber + ...
    food_carbh + food_fat + food_protein;
if Test_Food_composition ~= 100 || isnan(Test_Food_composition)
    errordlg('Check Food Composition', 'ERROR')
    return
end
% =========================================================================
Temperature_retort = str2double(get(handles.T_retort_data,'string'));
Temperature_cooling = str2double(get(handles.T_cooling_data,'string'));
Food_Initial_Temperature = str2double(get(handles.food_initial_temp,'string'));
time_full_process = str2double(get(handles.total_time_process,'string'));
time_cooling = str2double(get(handles.cooling_time,'string'));
% =========================================================================
if isnan(Temperature_retort) || Temperature_retort <= 0
    errordlg('Input a number for Retort Temperature','ERROR')
    return
end
if isnan(Temperature_cooling) || Temperature_cooling <= 0
    errordlg('Input a number for Cooling Temperature','ERROR')
    return
end
if isnan(Food_Initial_Temperature)
    errordlg('Input a number for Food Initial Temperature','ERROR')
    return
end
if isnan(time_full_process) || time_full_process <= 0 
    errordlg('Input a number for Total Time Process - TTP','ERROR')
    return
end
if isnan(time_cooling) || time_cooling <= 0 
    errordlg('Input a number for Start Cooling Time - SCT','ERROR')
    return
end
if Temperature_cooling >= Temperature_retort
    errordlg('Cooling Temperature is greater or equals to the Temperature of the Retort','ERROR')
    return
end
if Food_Initial_Temperature >= Temperature_retort
    errordlg('Food Initial Temperature is greater or equals to the Temperature of the Retort','ERROR')
    return
end
if time_cooling >= time_full_process
    errordlg('Check the Start Cooling time value seems to be greater than the entire process','ERROR')
    return
end
% =========================================================================
[rho,k,Cp,alpha]=choiokos(Food_Initial_Temperature,food_protein,food_fat,food_carbh,...
    food_fiber,food_ash,food_water,0);
% =========================================================================
[T_center,T_retort,rho_time,k_time,Cp_time,alpha_time,...
    ct,X,Y,x,y,t]=simul_process(rho,k,Cp,alpha,SI_can_internal_diameter,...
    SI_can_height,time_full_process,time_cooling,...
    Food_Initial_Temperature,Temperature_retort,Temperature_cooling,...
    food_protein,food_fat,food_carbh,...
    food_fiber,food_ash,food_water);
% =========================================================================
figure(1);
axes1 = axes('Parent',figure(1),'FontSize',12);
box(axes1,'on');
hold(axes1,'all');
plot(t,T_center,'LineWidth',2,'Color',[1,0,0]), hold on
plot(t,T_retort,'LineWidth',2,'Color',[0,0,0])
xlabel('time [min]','Fontsize',12)
ylabel('Temperature [C]','Fontsize',12)
legend('Temperature @ Center','Retort Temperature',1)
plot_Tcenter_Tretort(t,T_center,T_retort)
figure(2);
z_value = str2double(get(handles.data_z,'string'));
T_ref_value = str2double(get(handles.data_Tref_D,'string'));
F_value = 10.^((T_center - T_ref_value)./z_value);
[AX,H1,H2] = plotyy(t,T_center,t,F_value);
set(AX,'FontSize',12,'YColor',[0 0 0])
set(get(AX(1),'Ylabel'),'String','Temperature [C]','FontSize',12,...
'Color',[1 0 0])
set(get(AX(2),'Ylabel'),'String','Lethal rate F','FontSize',12,...
'Color',[0 0 0])
set(H1,'LineWidth',2,'Color',[1 0 0])
set(H2,'LineWidth',2,'Color',[0 0 0])
xlabel('time [min]','FontSize',12)
legend('Temperature @ Center','F_{Value}',2)
valor_integral = trapz(t,F_value);
set(handles.F_value,'string',valor_integral)
saveas(figure(2),'T_center_F_plot.eps', 'psc2')
saveas(figure(2),'T_center_F_plot', 'png')
% =========================================================================
figure(3);
subplot(2,2,1)
plot(t,rho_time,'LineWidth',2,'Color',[0,0,1])
% Create xlabel
xlabel('tiempo [min]','FontWeight','bold');
% Create ylabel
ylabel('\rho [kg/m^3]','FontWeight','bold');
plot_T_rho_save(t,rho_time)
subplot(2,2,2)
plot(t,k_time,'LineWidth',2,'Color',[0,0,1])
% Create xlabel
xlabel('tiempo [min]','FontWeight','bold');
% Create ylabel
ylabel('k [W/m.K]','FontWeight','bold');
plot_T_k_save(t,k_time)
subplot(2,2,3)
plot(t,Cp_time,'LineWidth',2,'Color',[0,0,1])
% Create xlabel
xlabel('tiempo [min]','FontWeight','bold');
% Create ylabel
ylabel('C_p [kJ/kg.K]','FontWeight','bold');
plot_T_Cp_save(t,Cp_time)
subplot(2,2,4)
plot(t,alpha_time,'LineWidth',2,'Color',[0,0,1])
% Create xlabel
xlabel('tiempo [min]','FontWeight','bold');
% Create ylabel
ylabel('\alpha [m^2/s]','FontWeight','bold');
plot_T_alpha_save(t,alpha_time)
figure(4)
plot3(t,T_center,rho_time,'LineWidth',2,'Color',[1,0,0])
xlabel('tiempo [min]','FontWeight','bold')
ylabel('Temperature [C]','FontWeight','bold')
zlabel('\rho [kg/m^3]','FontWeight','bold')
saveas(figure(4),'3D_T_center_rho_time_plot.eps', 'psc2')
saveas(figure(4),'3D_T_center_rho_time_plot', 'png')
figure(5)
plot3(t,T_center,k_time,'LineWidth',2,'Color',[1,0,0])
xlabel('tiempo [min]','FontWeight','bold')
ylabel('Temperature [C]','FontWeight','bold')
zlabel('k [W/m.K]','FontWeight','bold')
saveas(figure(5),'3D_T_center_k_time_plot.eps', 'psc2')
saveas(figure(5),'3D_T_center_k_time_plot', 'png')
figure(6)
plot3(t,T_center,Cp_time,'LineWidth',2,'Color',[1,0,0])
xlabel('tiempo [min]','FontWeight','bold')
ylabel('Temperature [C]','FontWeight','bold')
zlabel('C_p [kJ/kg.K]','FontWeight','bold')
saveas(figure(6),'3D_T_center_Cp_time_plot.eps', 'psc2')
saveas(figure(6),'3D_T_center_Cp_time_plot', 'png')
figure(7)
plot3(t,T_center,alpha_time,'LineWidth',2,'Color',[1,0,0])
xlabel('tiempo [min]','FontWeight','bold')
ylabel('Temperature [C]','FontWeight','bold')
zlabel('\alpha [m^2/s]','FontWeight','bold')
saveas(figure(7),'3D_T_center_alpha_time_plot.eps', 'psc2')
saveas(figure(7),'3D_T_center_alpha_time_plot', 'png')
% =========================================================================
savefile = 'Temperature_Center_time.mat';
save(savefile,'t','T_center')
savefile = 'F_time.mat';
save(savefile,'t','F_value')
savefile = 'Thermal_properties_time.mat';
save(savefile,'t','rho_time','k_time','Cp_time','alpha_time')
savefile = 'Complete_values.mat';
save(savefile,'t','T_center','F_value','rho_time','k_time','Cp_time','alpha_time')
save -ascii Thermal_properties_time.dat t rho_time k_time Cp_time alpha_time
% =========================================================================
% --- Executes on selection change in popmenu_kineticfactors.
function popmenu_kineticfactors_Callback(hObject, eventdata, handles)
% hObject    handle to popmenu_kineticfactors (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: contents = cellstr(get(hObject,'String')) returns popmenu_kineticfactors contents as cell array
%        contents{get(hObject,'Value')} returns selected item from popmenu_kineticfactors

kineticfactors_number = get(handles.popmenu_kineticfactors,'Value');
if kineticfactors_number == 62
    %custom_kinetic_factors
    %uiwait
    %global custom_internal_diameter custom_can_height
    %set(handles.internal_diameter,'String',custom_internal_diameter);
    %set(handles.height,'String',custom_can_height);
    %SI_can_internal_diameter = custom_internal_diameter/1000;
    %SI_can_height = custom_can_height/1000;
else
    [kinetic_factors_Tref_k,kinetic_factors_Tref_D,...
    kinetic_factors_kT,kinetic_factors_EA...
    kinetic_factors_logA,kinetic_factors_D...
    kinetic_factors_z] = kinetic_factors_microbial_inactivation(kineticfactors_number);
    set(handles.data_Tref_k,'String',kinetic_factors_Tref_k);
    set(handles.data_Tref_D,'String',kinetic_factors_Tref_D);
    set(handles.data_kT,'String',kinetic_factors_kT);
    set(handles.data_EA,'String',kinetic_factors_EA);
    set(handles.data_log_A,'String',kinetic_factors_logA);
    set(handles.data_D,'String',kinetic_factors_D);
    set(handles.data_z,'String',kinetic_factors_z);
end
% --- Executes during object creation, after setting all properties.
function popmenu_kineticfactors_CreateFcn(hObject, eventdata, handles)
% hObject    handle to popmenu_kineticfactors (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: popupmenu 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 total_time_process_Callback(hObject, eventdata, handles)
% hObject    handle to total_time_process (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 total_time_process as text
%        str2double(get(hObject,'String')) returns contents of total_time_process as a double


% --- Executes during object creation, after setting all properties.
function total_time_process_CreateFcn(hObject, eventdata, handles)
% hObject    handle to total_time_process (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 cooling_time_Callback(hObject, eventdata, handles)
% hObject    handle to cooling_time (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 cooling_time as text
%        str2double(get(hObject,'String')) returns contents of cooling_time as a double


% --- Executes during object creation, after setting all properties.
function cooling_time_CreateFcn(hObject, eventdata, handles)
% hObject    handle to cooling_time (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 food_initial_temp_Callback(hObject, eventdata, handles)
% hObject    handle to food_initial_temp (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 food_initial_temp as text
%        str2double(get(hObject,'String')) returns contents of food_initial_temp as a double


% --- Executes during object creation, after setting all properties.
function food_initial_temp_CreateFcn(hObject, eventdata, handles)
% hObject    handle to food_initial_temp (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 T_retort_data_Callback(hObject, eventdata, handles)
% hObject    handle to T_retort_data (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 T_retort_data as text
%        str2double(get(hObject,'String')) returns contents of T_retort_data as a double


% --- Executes during object creation, after setting all properties.
function T_retort_data_CreateFcn(hObject, eventdata, handles)
% hObject    handle to T_retort_data (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 T_cooling_data_Callback(hObject, eventdata, handles)
% hObject    handle to T_cooling_data (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 T_cooling_data as text
%        str2double(get(hObject,'String')) returns contents of T_cooling_data as a double


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

Contact us