close all
hf=figure('toolbar','figure',...
'Units','Normalized',...
'Position',[0.1 0.1 0.8 0.8],...
'Color',[0.9412 0.9412 0.9412]);
% global parameter
global he1 he2 he3 he4 he5 he6 he7 he8 he9 he10 he11 he12 hpop1 hpop2 hlb1 hcb1 addn x y ha1 LBN LBCA
addn=0; % count of the add or delete click number
x=[]; % for surface energy fit x axis
y=[]; %for surface energy fit y axis
LBN={}; %list box luquid name
LBCA=0; % list box contact angle
% panel
hp1=uipanel('Title','Input Data','BackgroundColor',[0.9412 0.9412 0.9412],...
'FontSize',13,...
'FontWeight','bold',...
'Units','Normalized',...
'Position',[0.02 0.65 0.6 0.30]);
hp2=uipanel('Title','Calaculation from equation',...
'FontSize',13,...
'FontWeight','bold',...
'Units','Normalized',...
'Position',[0.70 0.6 0.2 0.35]);
hp3=uipanel('Title','Results',...
'FontSize',13,...
'FontWeight','bold',...
'Units','Normalized',...
'Position',[0.02 0.45 0.6 0.17]);
hp4=uipanel('Title','Add&Delete Poits',...
'FontSize',13,...
'FontWeight','bold',...
'Units','Normalized',...
'Position',[0.68 0.02 0.28 0.5]);
% button
hb1=uicontrol(...
'Style','pushbutton',...
'String','Calculate',...
'FontSize',12,...
'FontWeight','bold',...
'Units','Normalized',...
'Position',[0.75 0.85 0.1 0.06],...
'Callback','fpush1');
hb2=uicontrol(...
'Style','pushbutton',...
'String','Save',...
'FontSize',12,...
'FontWeight','bold',...
'Units','Normalized',...
'Position',[0.75 0.75 0.1 0.06],...
'Callback','fpush2');
hb3=uicontrol(...
'Style','pushbutton',...
'String','Clear&Default',...
'FontSize',12,...
'FontWeight','bold',...
'Units','Normalized',...
'Position',[0.73 0.65 0.14 0.06],...
'Callback','fpush3');
hb4=uicontrol(...
'Style','pushbutton',...
'String','Add',...
'FontSize',12,...
'FontWeight','bold',...
'Units','Normalized',...
'Position',[0.69 0.42 0.10 0.06],...
'Callback','fpush4');
uicontrol(...
'Style','pushbutton',...
'String','Add',...
'FontSize',12,...
'FontWeight','bold',...
'Units','Normalized',...
'Position',[0.63 0.81 0.06 0.06],...
'Callback','fpush4');
hb5=uicontrol(...
'Style','pushbutton',...
'String','Delete',...
'FontSize',12,...
'FontWeight','bold',...
'Units','Normalized',...
'Position',[0.80 0.42 0.10 0.06],...
'Callback','fpush5');
hb6=uicontrol(...
'Style','pushbutton',...
'String','Fit Surface Energy',...
'FontSize',12,...
'FontWeight','bold',...
'Units','Normalized',...
'Position',[0.49 0.25 0.18 0.06],...
'Callback','fpush6');
hb7=uicontrol(...
'Style','pushbutton',...
'String','Save Results',...
'FontSize',12,...
'FontWeight','bold',...
'Units','Normalized',...
'Position',[0.49 0.15 0.18 0.06],...
'Callback','fpush7');
%text
ht1=uicontrol(...
'Style','text',...
'String','Liquid One:',...
'FontSize',12,...
'FontWeight','bold',...
'Units','Normalized',...
'Position',[0.025 0.80 0.1 0.05]);
ht2=uicontrol(...
'Style','text',...
'String','Liquid Two:',...
'FontSize',12,...
'FontWeight','bold',...
'Units','Normalized',...
'Position',[0.025 0.66 0.1 0.04]);
ht3=uicontrol(...
'Style','text',...
'String','Solid Surface Energy',...
'FontSize',12,...
'FontWeight','bold',...
'Units','Normalized',...
'Position',[0.06 0.48 0.18 0.03]);
ht4=uicontrol(...
'Style','text',...
'String','Dispersion(rd)',...
'FontSize',12,...
'FontWeight','bold',...
'Units','Normalized',...
'Position',[0.22 0.85 0.12 0.05]);
ht5=uicontrol(...
'Style','text',...
'String','Polar(rp)',...
'FontSize',12,...
'FontWeight','bold',...
'Units','Normalized',...
'Position',[0.35 0.85 0.08 0.05]);
ht6=uicontrol(...
'Style','text',...
'String','Contact Angle(Degree)',...
'FontSize',12,...
'FontWeight','bold',...
'Units','Normalized',...
'Position',[0.48 0.86 0.12 0.05]);
ht7=uicontrol(...
'Style','text',...
'String','Dispersion(rd)',...
'FontSize',12,...
'FontWeight','bold',...
'Units','Normalized',...
'Position',[0.22 0.70 0.12 0.05]);
ht8=uicontrol(...
'Style','text',...
'String','Polar(rp)',...
'FontSize',12,...
'FontWeight','bold',...
'Units','Normalized',...
'Position',[0.35 0.7 0.08 0.05]);
ht9=uicontrol(...
'Style','text',...
'String','Contact Angle(Degree)',...
'FontSize',12,...
'FontWeight','bold',...
'Units','Normalized',...
'Position',[0.48 0.72 0.12 0.05]);
ht10=uicontrol(...
'Style','text',...
'String','Dispersion(mN/m)',...
'FontSize',12,...
'FontWeight','bold',...
'Units','Normalized',...
'Position',[0.23 0.52 0.15 0.05]);
ht11=uicontrol(...
'Style','text',...
'String','Polar(mN/m)',...
'FontSize',12,...
'FontWeight','bold',...
'Units','Normalized',...
'Position',[0.38 0.52 0.10 0.05]);
ht12=uicontrol(...
'Style','text',...
'String','Total(mN/m)',...
'FontSize',12,...
'FontWeight','bold',...
'ForegroundColor',[1 0 0],...
'Units','Normalized',...
'Position',[0.48 0.52 0.12 0.05]);
ht13=uicontrol(...
'Style','text',...
'String','Note: The unit of surface energy is mN/m',...
'FontSize',12,...
'FontWeight','bold',...
'ForegroundColor',[0 0 1],...
'Units','Normalized',...
'Position',[0.1 0.61 0.4 0.04]);
% text
% edit text
% liquid name 1
he1=uicontrol(...
'Style','edit',...
'String','Name 1',...
'FontSize',12,...
'FontWeight','bold',...
'Units','Normalized',...
'Position',[0.12 0.815 0.12 0.04],...
'BackgroundColor','white');
%liquid name 2
he2=uicontrol(...
'Style','edit',...
'String','Name 2',...
'FontSize',12,...
'FontWeight','bold',...
'Units','Normalized',...
'Position',[0.12 0.665 0.12 0.04],...
'BackgroundColor','white');
% liquid 1 dispersion
he3=uicontrol(...
'Style','edit',...
'String','1',...
'FontSize',12,...
'FontWeight','bold',...
'Units','Normalized',...
'Position',[0.25 0.81 0.06 0.05],...
'BackgroundColor','white');
% liquid 1 polar
he4=uicontrol(...
'Style','edit',...
'String','0',...
'FontSize',12,...
'FontWeight','bold',...
'Units','Normalized',...
'Position',[0.35 0.81 0.06 0.05],...
'BackgroundColor','white');
% liquid 1 contact angle
he5=uicontrol(...
'Style','edit',...
'String','90',...
'FontSize',12,...
'FontWeight','bold',...
'Units','Normalized',...
'Position',[0.5 0.81 0.06 0.05],...
'BackgroundColor','white');%,...
% 'Callback','fpush4');
% liquid 2 dispersion
he6=uicontrol(...
'Style','edit',...
'String','0',...
'FontSize',12,...
'FontWeight','bold',...
'Units','Normalized',...
'Position',[0.25 0.66 0.06 0.05],...
'BackgroundColor','white');
% liquid 2 polar
he7=uicontrol(...
'Style','edit',...
'String','1',...
'FontSize',12,...
'FontWeight','bold',...
'Units','Normalized',...
'Position',[0.35 0.66 0.06 0.05],...
'BackgroundColor','white');
% liquid 2 contact angle
he8=uicontrol(...
'Style','edit',...
'String','90',...
'FontSize',12,...
'FontWeight','bold',...
'Units','Normalized',...
'Position',[0.5 0.66 0.06 0.05],...
'BackgroundColor','white');
% dispersion surface energy of solid
he9=uicontrol(...
'Style','edit',...
'String','No Output',...
'FontSize',12,...
'FontWeight','bold',...
'Units','Normalized',...
'Position',[0.25 0.47 0.09 0.05],...
'BackgroundColor','white');
% polar surface energy of solid
he10=uicontrol(...
'Style','edit',...
'String','No Output',...
'FontSize',12,...
'FontWeight','bold',...
'Units','Normalized',...
'Position',[0.39 0.47 0.09 0.05],...
'BackgroundColor','white');
% Total surface energy
he11=uicontrol(...
'Style','edit',...
'String','No Output',...
'FontSize',12,...
'FontWeight','bold',...
'Units','Normalized',...
'Position',[0.5 0.47 0.09 0.05],...
'BackgroundColor','white');
he12=uicontrol(...
'Style','edit',...
'String','Sample Name',...
'FontSize',12,...
'FontWeight','bold',...
'Units','Normalized',...
'Position',[0.3 0.94 0.12 0.05],...
'BackgroundColor','white');
uicontrol(...
'Style','text',...
'String','Input Sample Na
评论2