function varargout = Gui1_export(varargin) % GUI1_EXPORT MATLAB code for Gui1_export.fig % GUI1_EXPORT, by itself, creates a new GUI1_EXPORT or raises the existing % singleton*. % % H = GUI1_EXPORT returns the handle to a new GUI1_EXPORT or the handle to % the existing singleton*. % % GUI1_EXPORT('CALLBACK',hObject,eventData,handles,...) calls the local % function named CALLBACK in GUI1_EXPORT.M with the given input arguments. % % GUI1_EXPORT('Property','Value',...) creates a new GUI1_EXPORT or raises % the existing singleton*. Starting from the left, property value pairs are % applied to the GUI before Gui1_export_OpeningFcn gets called. An % unrecognized property name or invalid value makes property application % stop. All inputs are passed to Gui1_export_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 Gui1_export % Last Modified by GUIDE v2.5 14-Mar-2016 17:37:16 % Begin initialization code - DO NOT EDIT gui_Singleton = 1; gui_State = struct('gui_Name', mfilename, ... 'gui_Singleton', gui_Singleton, ... 'gui_OpeningFcn', @Gui1_export_OpeningFcn, ... 'gui_OutputFcn', @Gui1_export_OutputFcn, ... 'gui_LayoutFcn', @Gui1_export_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 Gui1_export is made visible. function Gui1_export_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 Gui1_export (see VARARGIN) % Choose default command line output for Gui1_export handles.output = hObject; % Update handles structure guidata(hObject, handles); initialize_gui(hObject, handles, false); % UIWAIT makes Gui1_export wait for user response (see UIRESUME) % uiwait(handles.figure1); % --- Outputs from this function are returned to the command line. function varargout = Gui1_export_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 during object creation, after setting all properties. function density_CreateFcn(hObject, eventdata, handles) % hObject handle to density (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 density_Callback(hObject, eventdata, handles) % hObject handle to density (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 density as text % str2double(get(hObject,'String')) returns contents of density as a double density = str2double(get(hObject, 'String')); if isnan(density) set(hObject, 'String', 0); errordlg('Input must be a number','Error'); end % Save the new density value handles.metricdata.density = density; guidata(hObject,handles) % --- Executes during object creation, after setting all properties. function volume_CreateFcn(hObject, eventdata, handles) % hObject handle to volume (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 volume_Callback(hObject, eventdata, handles) % hObject handle to volume (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 volume as text % str2double(get(hObject,'String')) returns contents of volume as a double volume = str2double(get(hObject, 'String')); if isnan(volume) set(hObject, 'String', 0); errordlg('Input must be a number','Error'); end % Save the new volume value handles.metricdata.volume = volume; guidata(hObject,handles) % --- 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) mass = handles.metricdata.density * handles.metricdata.volume; set(handles.mass, 'String', mass); % --- Executes on button press in reset. function reset_Callback(hObject, eventdata, handles) % hObject handle to reset (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) initialize_gui(gcbf, handles, true); % --- Executes when selected object changed in unitgroup. function unitgroup_SelectionChangeFcn(hObject, eventdata, handles) % hObject handle to the selected object in unitgroup % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) if (hObject == handles.english) set(handles.text4, 'String', 'lb/cu.in'); set(handles.text5, 'String', 'cu.in'); set(handles.text6, 'String', 'lb'); else set(handles.text4, 'String', 'kg/cu.m'); set(handles.text5, 'String', 'cu.m'); set(handles.text6, 'String', 'kg'); end % -------------------------------------------------------------------- function initialize_gui(fig_handle, handles, isreset) % If the metricdata field is present and the reset flag is false, it means % we are we are just re-initializing a GUI by calling it from the cmd line % while it is up. So, bail out as we dont want to reset the data. if isfield(handles, 'metricdata') && ~isreset return; end handles.metricdata.density = 0; handles.metricdata.volume = 0; set(handles.density, 'String', handles.metricdata.density); set(handles.volume, 'String', handles.metricdata.volume); set(handles.mass, 'String', 0); set(handles.unitgroup, 'SelectedObject', handles.english); set(handles.text4, 'String', 'lb/cu.in'); set(handles.text5, 'String', 'cu.in'); set(handles.text6, 'String', 'lb'); % Update handles structure guidata(handles.figure1, handles); % --- Creates and returns a handle to the GUI figure. function h1 = Gui1_export_LayoutFcn(policy) % policy - create a new figure or use a singleton. 'new' or 'reuse'. persistent hsingleton; if strcmpi(policy, 'reuse') & ishandle(hsingleton) h1 = hsingleton; return; end load Gui1_export.mat appdata = []; appdata.GUIDEOptions = struct(... 'active_h', [], ... 'taginfo', struct(... 'figure', 2, ... 'pushbutton', 9, ... 'text', 15, ... 'edit', 6, ... 'frame', 4, ... 'radiobutton', 19, ... 'uipanel', 11), ... 'override', 1, ... 'release', 13, ... 'resize', 'simple', ... 'accessibility', 'callback', ... 'mfile', 1, ... 'callbacks', 1, ... 'singleton', 1, ... 'syscolorfig', 1, ... 'blocking', 0, ... 'lastSavedFile', '/Users/Ego/Documents/MT&C/Consulting/Raadsys/Translarity/tab integration concept/Gui1_export.m', ... 'lastFilename', '/Users/Ego/Documents/MT&C/Consulting/Raadsys/Translarity/tab integration concept/Gui1.fig'); appdata.lastValidTag = 'figure1'; appdata.GUIDELayoutEditor = []; appdata.initTags = struct(... 'handle', [], ... 'tag', 'figure1'); h1 = figure(... 'PaperUnits',get(0,'defaultfigurePaperUnits'),... 'Color',[0.929411764705882 0.929411764705882 0.929411764705882],... 'Colormap',[0 0 0.5625;0 0 0.625;0 0 0.6875;0 0 0.75;0 0 0.8125;0 0 0.875;0 0 0.9375;0 0 1;0 0.0625 1;0 0.125 1;0 0.1875 1;0 0.25 1;0 0.3125 1;0 0.375 1;0 0.4375 1;0 0.5 1;0 0.5625 1;0 0.625 1;0 0.6875 1;0 0.75 1;0 0.8125 1;0 0.875 1;0 0.9375 1;0 1 1;0.0625 1 1;0.125 1 0.9375;0.1875 1 0.875;0.25 1 0.8125;0.3125 1 0.75;0.375 1 0.6875;0.4375 1 0.625;0.5 1 0.5625;0.5625 1 0.5;0.625 1 0.4375;0.6875 1 0.375;0.75 1 0.3125;0.8125 1 0.25;0.875 1 0.1875;0.9375 1 0.125;1 1 0.0625;1 1 0;1 0.9375 0;1 0.875 0;1 0.8125 0;1 0.75 0;1 0.6875 0;1 0.625 0;1 0.5625 0;1 0.5 0;1 0.4375 0;1 0.375 0;1 0.3125 0;1 0.25 0;1 0.1875 0;1 0.125 0;1 0.0625 0;1 0 0;0.9375 0 0;0.875 0 0;0.8125 0 0;0.75 0 0;0.6875 0 0;0.625 0 0;0.5625 0 0],... 'DockControls','off',... 'IntegerHandle','off',... 'InvertHardcopy',get(0,'defaultfigureInvertHardcopy'),... 'MenuBar','none',... 'Name','Gui1',... 'NumberTitle','off',... 'PaperPosition',get(0,'defaultfigurePaperPosition'),... 'PaperSize',get(0,'defaultfigurePaperSize'),... 'PaperType',get(0,'defaultfigurePaperType'),... 'Position',[544 485 400 140],... 'HandleVisibility','callback',... 'UserData',[],... 'Tag','figure1',... 'Visible','on',... 'CreateFcn', {@local_CreateFcn, blanks(0), appdata} ); appdata = []; appdata.lastValidTag = 'calculate'; %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% TAB CREATION %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% ht = uitabgroup('parent',h1,'Position',[0 0 1 1]); h1tab = uitab(ht,'title','GUI 1'); h2tab = uitab(ht,'title','GUI 2'); h2 = uicontrol(... 'Parent',h1tab,... 'Units','normalized',... 'Callback',@(hObject,eventdata)Gui1_export('calculate_Callback',hObject,eventdata,guidata(hObject)),... 'CData',[],... 'ListboxTop',0,... 'Position',[0.603305785123967 0.0615384615384615 0.165289256198347 0.169230769230769],... 'String','Calculate',... 'UserData',[],... 'Tag','calculate',... 'CreateFcn', {@local_CreateFcn, blanks(0), appdata} ); appdata = []; appdata.lastValidTag = 'reset'; h3 = uicontrol(... 'Parent',h1tab,... 'Units','normalized',... 'Callback',@(hObject,eventdata)Gui1_export('reset_Callback',hObject,eventdata,guidata(hObject)),... 'CData',[],... 'ListboxTop',0,... 'Position',[0.796143250688705 0.0615384615384615 0.168044077134986 0.169230769230769],... 'String','Reset',... 'UserData',[],... 'Tag','reset',... 'CreateFcn', {@local_CreateFcn, blanks(0), appdata} ); appdata = []; appdata.lastValidTag = 'uipanel1'; h4 = uipanel(... 'Parent',h1tab,... 'Title','Measures',... 'Tag','uipanel1',... 'UserData',[],... 'Clipping','on',... 'Position',[0.0275482093663912 0.0615384615384615 0.553719008264463 0.892307692307692],... 'CreateFcn', {@local_CreateFcn, blanks(0), appdata} ); appdata = []; appdata.lastValidTag = 'text1'; h5 = uicontrol(... 'Parent',h4,... 'Units','normalized',... 'CData',[],... 'HorizontalAlignment','right',... 'ListboxTop',0,... 'Position',[0.0248756218905473 0.648648648648649 0.298507462686567 0.135135135135135],... 'String','Density(D):',... 'Style','text',... 'UserData',[],... 'Tag','text1',... 'CreateFcn', {@local_CreateFcn, blanks(0), appdata} ); appdata = []; appdata.lastValidTag = 'text2'; h6 = uicontrol(... 'Parent',h4,... 'Units','normalized',... 'CData',[],... 'HorizontalAlignment','right',... 'ListboxTop',0,... 'Position',[0.0248756218905473 0.36936936936937 0.298507462686567 0.135135135135135],... 'String','Volume(V):',... 'Style','text',... 'UserData',[],... 'Tag','text2',... 'CreateFcn', {@local_CreateFcn, blanks(0), appdata} ); appdata = []; appdata.lastValidTag = 'density'; h7 = uicontrol(... 'Parent',h4,... 'Units','normalized',... 'BackgroundColor',[1 1 1],... 'Callback',@(hObject,eventdata)Gui1_export('density_Callback',hObject,eventdata,guidata(hObject)),... 'HorizontalAlignment','right',... 'ListboxTop',0,... 'Position',[0.36318407960199 0.63063063063063 0.348258706467662 0.18018018018018],... 'String','0',... 'Style','edit',... 'CreateFcn', {@local_CreateFcn, @(hObject,eventdata)Gui1_export('density_CreateFcn',hObject,eventdata,guidata(hObject)), appdata} ,... 'Tag','density'); appdata = []; appdata.lastValidTag = 'volume'; h8 = uicontrol(... 'Parent',h4,... 'Units','normalized',... 'BackgroundColor',[1 1 1],... 'Callback',@(hObject,eventdata)Gui1_export('volume_Callback',hObject,eventdata,guidata(hObject)),... 'HorizontalAlignment','right',... 'ListboxTop',0,... 'Position',[0.36318407960199 0.351351351351351 0.348258706467662 0.18018018018018],... 'String','0',... 'Style','edit',... 'CreateFcn', {@local_CreateFcn, @(hObject,eventdata)Gui1_export('volume_CreateFcn',hObject,eventdata,guidata(hObject)), appdata} ,... 'Tag','volume'); appdata = []; appdata.lastValidTag = 'mass'; h9 = uicontrol(... 'Parent',h4,... 'Units','normalized',... 'CData',[],... 'Enable','inactive',... 'HorizontalAlignment','right',... 'ListboxTop',0,... 'Position',[0.36318407960199 0.054054054054054 0.348 0.135135135135135],... 'String','0',... 'Style','text',... 'UserData',[],... 'Tag','mass',... 'CreateFcn', {@local_CreateFcn, blanks(0), appdata} ); appdata = []; appdata.lastValidTag = 'text3'; h10 = uicontrol(... 'Parent',h4,... 'Units','normalized',... 'CData',[],... 'HorizontalAlignment','right',... 'ListboxTop',0,... 'Position',[0.0248756218905473 0.054054054054054 0.298507462686567 0.135135135135135],... 'String','Mass(D*V):',... 'Style','text',... 'UserData',[],... 'Tag','text3',... 'CreateFcn', {@local_CreateFcn, blanks(0), appdata} ); appdata = []; appdata.lastValidTag = 'text6'; h11 = uicontrol(... 'Parent',h4,... 'Units','normalized',... 'CData',[],... 'HorizontalAlignment','left',... 'ListboxTop',0,... 'Position',[0.761194029850746 0.054054054054054 0.199 0.135135135135135],... 'String','lb',... 'Style','text',... 'UserData',[],... 'Tag','text6',... 'CreateFcn', {@local_CreateFcn, blanks(0), appdata} ); appdata = []; appdata.lastValidTag = 'text4'; h12 = uicontrol(... 'Parent',h4,... 'Units','normalized',... 'HorizontalAlignment','left',... 'ListboxTop',0,... 'Position',[0.761194029850746 0.648648648648649 0.199 0.135135135135135],... 'String','lb/cu.in',... 'Style','text',... 'Tag','text4',... 'CreateFcn', {@local_CreateFcn, blanks(0), appdata} ); appdata = []; appdata.lastValidTag = 'text5'; h13 = uicontrol(... 'Parent',h4,... 'Units','normalized',... 'HorizontalAlignment','left',... 'ListboxTop',0,... 'Position',[0.761194029850746 0.36936936936937 0.199 0.135135135135135],... 'String','cu.in',... 'Style','text',... 'Tag','text5',... 'CreateFcn', {@local_CreateFcn, blanks(0), appdata} ); appdata = []; appdata.lastValidTag = 'unitgroup'; h14 = uibuttongroup(... 'Parent',h1tab,... 'Title','Units',... 'Tag','unitgroup',... 'Clipping','on',... 'Position',[0.603305785123967 0.369230769230769 0.360881542699725 0.584615384615385],... 'SelectedObject',[],... 'SelectionChangeFcn',@(hObject,eventdata)Gui1_export('unitgroup_SelectionChangeFcn',get(hObject,'SelectedObject'),eventdata,guidata(get(hObject,'SelectedObject'))),... 'OldSelectedObject',[],... 'CreateFcn', {@local_CreateFcn, blanks(0), appdata} ); appdata = []; appdata.lastValidTag = 'english'; h15 = uicontrol(... 'Parent',h14,... 'Units','normalized',... 'Callback',mat{1},... 'Position',[0.0610687022900763 0.460526315789474 0.9 0.2],... 'String','English Unit System',... 'Style','radiobutton',... 'Value',1,... 'Tag','english',... 'CreateFcn', {@local_CreateFcn, blanks(0), appdata} ); appdata = []; appdata.lastValidTag = 'si'; h16 = uicontrol(... 'Parent',h14,... 'Units','normalized',... 'Callback',mat{2},... 'Position',[0.0610687022900763 0.131578947368421 0.9 0.2],... 'String','S.I. Unit System',... 'Style','radiobutton',... 'Tag','si',... 'CreateFcn', {@local_CreateFcn, blanks(0), appdata} ); %%%%%%% End of Gui1 Object Definitions %%%%%% % load Gui2_export.mat %%%%%%% Begin Gui2 Object Definitions %%%%%% appdata = []; appdata.lastValidTag = 'axes1'; h2 = axes(... 'Parent',h2tab,... 'FontUnits','normalized',... 'Position',[0.05 0.1 0.9 0.7],... 'ALim',get(0,'defaultaxesALim'),... 'ALimMode','manual',... 'CameraPosition',[0.5 0.5 9.16025403784439],... 'CameraPositionMode','manual',... 'CameraTarget',[0.5 0.5 0.5],... 'CameraTargetMode','manual',... 'CameraUpVector',[0 1 0],... 'CameraUpVectorMode','manual',... 'CameraViewAngle',6.60861036031192,... 'CameraViewAngleMode','manual',... 'CLim',get(0,'defaultaxesCLim'),... 'CLimMode','manual',... 'Color',get(0,'defaultaxesColor'),... 'ColorOrder',get(0,'defaultaxesColorOrder'),... 'DataAspectRatio',get(0,'defaultaxesDataAspectRatio'),... 'DataAspectRatioMode','manual',... 'FontSize',0.0907029478458049,... 'GridLineStyle','-',... 'LooseInset',[0.13 0.11 0.095 0.075],... 'PlotBoxAspectRatio',get(0,'defaultaxesPlotBoxAspectRatio'),... 'PlotBoxAspectRatioMode','manual',... 'TickDir',get(0,'defaultaxesTickDir'),... 'TickDirMode','manual',... 'XColor',get(0,'defaultaxesXColor'),... 'XLim',get(0,'defaultaxesXLim'),... 'XLimMode','manual',... 'XTick',[0 0.2 0.4 0.6 0.8 1],... 'XTickLabel',{ '0 '; '0.2'; '0.4'; '0.6'; '0.8'; '1 ' },... 'XTickLabelMode','manual',... 'XTickMode','manual',... 'YColor',get(0,'defaultaxesYColor'),... 'YLim',get(0,'defaultaxesYLim'),... 'YLimMode','manual',... 'YTick',[0 0.2 0.4 0.6 0.8 1],... 'YTickLabel',{ '0 '; '0.2'; '0.4'; '0.6'; '0.8'; '1 ' },... 'YTickLabelMode','manual',... 'YTickMode','manual',... 'ZColor',get(0,'defaultaxesZColor'),... 'ZLim',get(0,'defaultaxesZLim'),... 'ZLimMode','manual',... 'ZTick',[0 0.5 1],... 'ZTickLabel',blanks(0),... 'ZTickLabelMode','manual',... 'ZTickMode','manual',... 'Tag','axes1',... 'UserData',[],... 'CreateFcn', {@local_CreateFcn, blanks(0), appdata} ); appdata = []; appdata.SerializedAnnotationV7 = struct(... 'LegendInformation', struct(... 'IconDisplayStyle', 'on')); h3 = get(h2,'title'); set(h3,... 'Parent',h2,... 'Units','data',... 'FontUnits','points',... 'BackgroundColor','none',... 'Color',[0 0 0],... 'DisplayName',blanks(0),... 'EdgeColor','none',... 'EraseMode','normal',... 'DVIMode','auto',... 'FontAngle','normal',... 'FontName','Helvetica',... 'FontSize',10,... 'FontWeight','normal',... 'HorizontalAlignment','center',... 'LineStyle','-',... 'LineWidth',0.5,... 'Margin',2,... 'Position',[0.490566037735849 1.05188679245283 1.00005459937205],... 'Rotation',0,... 'String',blanks(0),... 'Interpreter','tex',... 'VerticalAlignment','bottom',... 'ButtonDownFcn',[],... 'CreateFcn', {@local_CreateFcn, [], appdata} ,... 'DeleteFcn',[],... 'BusyAction','queue',... 'HandleVisibility','off',... 'HelpTopicKey',blanks(0),... 'HitTest','on',... 'Interruptible','on',... 'SelectionHighlight','on',... 'Serializable','on',... 'Tag',blanks(0),... 'UserData',[],... 'Visible','on',... 'XLimInclude','on',... 'YLimInclude','on',... 'ZLimInclude','on',... 'CLimInclude','on',... 'ALimInclude','on',... 'IncludeRenderer','on',... 'Clipping','off'); appdata = []; appdata.SerializedAnnotationV7 = struct(... 'LegendInformation', struct(... 'IconDisplayStyle', 'on')); h4 = get(h2,'xlabel'); set(h4,... 'Parent',h2,... 'Units','data',... 'FontUnits','points',... 'BackgroundColor','none',... 'Color',[0.15 0.15 0.15],... 'DisplayName',blanks(0),... 'EdgeColor','none',... 'EraseMode','normal',... 'DVIMode','auto',... 'FontAngle','normal',... 'FontName','Helvetica',... 'FontSize',10,... 'FontWeight','normal',... 'HorizontalAlignment','center',... 'LineStyle','-',... 'LineWidth',0.5,... 'Margin',2,... 'Position',[0.490566037735849 -0.174528301886792 1.00005459937205],... 'Rotation',0,... 'String',blanks(0),... 'Interpreter','tex',... 'VerticalAlignment','top',... 'ButtonDownFcn',[],... 'CreateFcn', {@local_CreateFcn, [], appdata} ,... 'DeleteFcn',[],... 'BusyAction','queue',... 'HandleVisibility','off',... 'HelpTopicKey',blanks(0),... 'HitTest','on',... 'Interruptible','on',... 'SelectionHighlight','on',... 'Serializable','on',... 'Tag',blanks(0),... 'UserData',[],... 'Visible','on',... 'XLimInclude','on',... 'YLimInclude','on',... 'ZLimInclude','on',... 'CLimInclude','on',... 'ALimInclude','on',... 'IncludeRenderer','on',... 'Clipping','off'); appdata = []; appdata.SerializedAnnotationV7 = struct(... 'LegendInformation', struct(... 'IconDisplayStyle', 'on')); h5 = get(h2,'ylabel'); set(h5,... 'Parent',h2,... 'Units','data',... 'FontUnits','points',... 'BackgroundColor','none',... 'Color',[0.15 0.15 0.15],... 'DisplayName',blanks(0),... 'EdgeColor','none',... 'EraseMode','normal',... 'DVIMode','auto',... 'FontAngle','normal',... 'FontName','Helvetica',... 'FontSize',10,... 'FontWeight','normal',... 'HorizontalAlignment','center',... 'LineStyle','-',... 'LineWidth',0.5,... 'Margin',2,... 'Position',[-0.235849056603774 0.495283018867924 1.00005459937205],... 'Rotation',90,... 'String',blanks(0),... 'Interpreter','tex',... 'VerticalAlignment','bottom',... 'ButtonDownFcn',[],... 'CreateFcn', {@local_CreateFcn, [], appdata} ,... 'DeleteFcn',[],... 'BusyAction','queue',... 'HandleVisibility','off',... 'HelpTopicKey',blanks(0),... 'HitTest','on',... 'Interruptible','on',... 'SelectionHighlight','on',... 'Serializable','on',... 'Tag',blanks(0),... 'UserData',[],... 'Visible','on',... 'XLimInclude','on',... 'YLimInclude','on',... 'ZLimInclude','on',... 'CLimInclude','on',... 'ALimInclude','on',... 'IncludeRenderer','on',... 'Clipping','off'); appdata = []; appdata.SerializedAnnotationV7 = struct(... 'LegendInformation', struct(... 'IconDisplayStyle', 'on')); h6 = get(h2,'zlabel'); set(h6,... 'Parent',h2,... 'Units','data',... 'FontUnits','points',... 'BackgroundColor','none',... 'Color',[0.15 0.15 0.15],... 'DisplayName',blanks(0),... 'EdgeColor','none',... 'EraseMode','normal',... 'DVIMode','auto',... 'FontAngle','normal',... 'FontName','Helvetica',... 'FontSize',10.9251700680272,... 'FontWeight','normal',... 'HorizontalAlignment','left',... 'LineStyle','-',... 'LineWidth',0.5,... 'Margin',3,... 'Position',[-1.44339622641509 1.66509433962264 1.00005459937205],... 'Rotation',0,... 'String',blanks(0),... 'Interpreter','tex',... 'VerticalAlignment','middle',... 'ButtonDownFcn',[],... 'CreateFcn', {@local_CreateFcn, [], appdata} ,... 'DeleteFcn',[],... 'BusyAction','queue',... 'HandleVisibility','off',... 'HelpTopicKey',blanks(0),... 'HitTest','on',... 'Interruptible','on',... 'SelectionHighlight','on',... 'Serializable','on',... 'Tag',blanks(0),... 'UserData',[],... 'Visible','off',... 'XLimInclude','on',... 'YLimInclude','on',... 'ZLimInclude','on',... 'CLimInclude','on',... 'ALimInclude','on',... 'IncludeRenderer','on',... 'Clipping','off'); appdata = []; appdata.lastValidTag = 'popupmenu1'; h7 = uicontrol(... 'Parent',h2tab,... 'Units','normalized',... 'BackgroundColor',[1 1 1],... 'Callback',@(hObject,eventdata)Gui2_export('popupmenu1_Callback',hObject,eventdata,guidata(hObject)),... 'ListboxTop',0,... 'Position',[0.1 0.76 0.456359102244389 0.25],... 'String',{ 'plot(rand(5))'; 'plot(sin(1:0.01:25))'; 'bar(1:.5:10)'; 'plot(membrane)'; 'surf(peaks)' },... 'Style','popupmenu',... 'Value',1,... 'CreateFcn', {@local_CreateFcn, @(hObject,eventdata)Gui2_export('popupmenu1_CreateFcn',hObject,eventdata,guidata(hObject)), appdata} ,... 'UserData',[],... 'Tag','popupmenu1'); appdata = []; appdata.lastValidTag = 'pushbutton1'; h8 = uicontrol(... 'Parent',h2tab,... 'Units','normalized',... 'BackgroundColor',[0.831 0.816 0.784],... 'Callback',@(hObject,eventdata)Gui2_export('pushbutton1_Callback',hObject,eventdata,guidata(hObject)),... 'ListboxTop',0,... 'Position',[0.6 0.8 0.301745635910224 0.25],... 'String','Update',... 'UserData',[],... 'Tag','pushbutton1',... 'CreateFcn', {@local_CreateFcn, blanks(0), appdata} ); %%%%%%% End of Gui2 Object Definitions %%%%%% hsingleton = h1; % --- Set application data first then calling the CreateFcn. function local_CreateFcn(hObject, eventdata, createfcn, appdata) if ~isempty(appdata) names = fieldnames(appdata); for i=1:length(names) name = char(names(i)); setappdata(hObject, name, getfield(appdata,name)); end end if ~isempty(createfcn) if isa(createfcn,'function_handle') createfcn(hObject, eventdata); else eval(createfcn); end end % --- Handles default GUIDE GUI creation and callback dispatch function varargout = gui_mainfcn(gui_State, varargin) gui_StateFields = {'gui_Name' 'gui_Singleton' 'gui_OpeningFcn' 'gui_OutputFcn' 'gui_LayoutFcn' 'gui_Callback'}; gui_Mfile = ''; for i=1:length(gui_StateFields) if ~isfield(gui_State, gui_StateFields{i}) error(message('MATLAB:guide:StateFieldNotFound', gui_StateFields{ i }, gui_Mfile)); elseif isequal(gui_StateFields{i}, 'gui_Name') gui_Mfile = [gui_State.(gui_StateFields{i}), '.m']; end end numargin = length(varargin); if numargin == 0 % GUI1_EXPORT % create the GUI only if we are not in the process of loading it % already gui_Create = true; elseif local_isInvokeActiveXCallback(gui_State, varargin{:}) % GUI1_EXPORT(ACTIVEX,...) vin{1} = gui_State.gui_Name; vin{2} = [get(varargin{1}.Peer, 'Tag'), '_', varargin{end}]; vin{3} = varargin{1}; vin{4} = varargin{end-1}; vin{5} = guidata(varargin{1}.Peer); feval(vin{:}); return; elseif local_isInvokeHGCallback(gui_State, varargin{:}) % GUI1_EXPORT('CALLBACK',hObject,eventData,handles,...) gui_Create = false; else % GUI1_EXPORT(...) % create the GUI and hand varargin to the openingfcn gui_Create = true; end if ~gui_Create % In design time, we need to mark all components possibly created in % the coming callback evaluation as non-serializable. This way, they % will not be brought into GUIDE and not be saved in the figure file % when running/saving the GUI from GUIDE. designEval = false; if (numargin>1 && ishghandle(varargin{2})) fig = varargin{2}; while ~isempty(fig) && ~ishghandle(fig,'figure') fig = get(fig,'parent'); end designEval = isappdata(0,'CreatingGUIDEFigure') || isprop(fig,'__GUIDEFigure'); end if designEval beforeChildren = findall(fig); end % evaluate the callback now varargin{1} = gui_State.gui_Callback; if nargout [varargout{1:nargout}] = feval(varargin{:}); else feval(varargin{:}); end % Set serializable of objects created in the above callback to off in % design time. Need to check whether figure handle is still valid in % case the figure is deleted during the callback dispatching. if designEval && ishghandle(fig) set(setdiff(findall(fig),beforeChildren), 'Serializable','off'); end else if gui_State.gui_Singleton gui_SingletonOpt = 'reuse'; else gui_SingletonOpt = 'new'; end % Check user passing 'visible' P/V pair first so that its value can be % used by oepnfig to prevent flickering gui_Visible = 'auto'; gui_VisibleInput = ''; for index=1:2:length(varargin) if length(varargin) == index || ~ischar(varargin{index}) break; end % Recognize 'visible' P/V pair len1 = min(length('visible'),length(varargin{index})); len2 = min(length('off'),length(varargin{index+1})); if ischar(varargin{index+1}) && strncmpi(varargin{index},'visible',len1) && len2 > 1 if strncmpi(varargin{index+1},'off',len2) gui_Visible = 'invisible'; gui_VisibleInput = 'off'; elseif strncmpi(varargin{index+1},'on',len2) gui_Visible = 'visible'; gui_VisibleInput = 'on'; end end end % Open fig file with stored settings. Note: This executes all component % specific CreateFunctions with an empty HANDLES structure. % Do feval on layout code in m-file if it exists gui_Exported = ~isempty(gui_State.gui_LayoutFcn); % this application data is used to indicate the running mode of a GUIDE % GUI to distinguish it from the design mode of the GUI in GUIDE. it is % only used by actxproxy at this time. setappdata(0,genvarname(['OpenGuiWhenRunning_', gui_State.gui_Name]),1); if gui_Exported gui_hFigure = feval(gui_State.gui_LayoutFcn, gui_SingletonOpt); % make figure invisible here so that the visibility of figure is % consistent in OpeningFcn in the exported GUI case if isempty(gui_VisibleInput) gui_VisibleInput = get(gui_hFigure,'Visible'); end set(gui_hFigure,'Visible','off') % openfig (called by local_openfig below) does this for guis without % the LayoutFcn. Be sure to do it here so guis show up on screen. movegui(gui_hFigure,'onscreen'); else gui_hFigure = local_openfig(gui_State.gui_Name, gui_SingletonOpt, gui_Visible); % If the figure has InGUIInitialization it was not completely created % on the last pass. Delete this handle and try again. if isappdata(gui_hFigure, 'InGUIInitialization') delete(gui_hFigure); gui_hFigure = local_openfig(gui_State.gui_Name, gui_SingletonOpt, gui_Visible); end end if isappdata(0, genvarname(['OpenGuiWhenRunning_', gui_State.gui_Name])) rmappdata(0,genvarname(['OpenGuiWhenRunning_', gui_State.gui_Name])); end % Set flag to indicate starting GUI initialization setappdata(gui_hFigure,'InGUIInitialization',1); % Fetch GUIDE Application options gui_Options = getappdata(gui_hFigure,'GUIDEOptions'); % Singleton setting in the GUI M-file takes priority if different gui_Options.singleton = gui_State.gui_Singleton; if ~isappdata(gui_hFigure,'GUIOnScreen') % Adjust background color if gui_Options.syscolorfig set(gui_hFigure,'Color', get(0,'DefaultUicontrolBackgroundColor')); end % Generate HANDLES structure and store with GUIDATA. If there is % user set GUI data already, keep that also. data = guidata(gui_hFigure); handles = guihandles(gui_hFigure); if ~isempty(handles) if isempty(data) data = handles; else names = fieldnames(handles); for k=1:length(names) data.(char(names(k)))=handles.(char(names(k))); end end end guidata(gui_hFigure, data); end % Apply input P/V pairs other than 'visible' for index=1:2:length(varargin) if length(varargin) == index || ~ischar(varargin{index}) break; end len1 = min(length('visible'),length(varargin{index})); if ~strncmpi(varargin{index},'visible',len1) try set(gui_hFigure, varargin{index}, varargin{index+1}), catch break, end end end % If handle visibility is set to 'callback', turn it on until finished % with OpeningFcn gui_HandleVisibility = get(gui_hFigure,'HandleVisibility'); if strcmp(gui_HandleVisibility, 'callback') set(gui_hFigure,'HandleVisibility', 'on'); end feval(gui_State.gui_OpeningFcn, gui_hFigure, [], guidata(gui_hFigure), varargin{:}); if isscalar(gui_hFigure) && ishghandle(gui_hFigure) % Handle the default callbacks of predefined toolbar tools in this % GUI, if any guidemfile('restoreToolbarToolPredefinedCallback',gui_hFigure); % Update handle visibility set(gui_hFigure,'HandleVisibility', gui_HandleVisibility); % Call openfig again to pick up the saved visibility or apply the % one passed in from the P/V pairs if ~gui_Exported gui_hFigure = local_openfig(gui_State.gui_Name, 'reuse',gui_Visible); elseif ~isempty(gui_VisibleInput) set(gui_hFigure,'Visible',gui_VisibleInput); end if strcmpi(get(gui_hFigure, 'Visible'), 'on') figure(gui_hFigure); if gui_Options.singleton setappdata(gui_hFigure,'GUIOnScreen', 1); end end % Done with GUI initialization if isappdata(gui_hFigure,'InGUIInitialization') rmappdata(gui_hFigure,'InGUIInitialization'); end % If handle visibility is set to 'callback', turn it on until % finished with OutputFcn gui_HandleVisibility = get(gui_hFigure,'HandleVisibility'); if strcmp(gui_HandleVisibility, 'callback') set(gui_hFigure,'HandleVisibility', 'on'); end gui_Handles = guidata(gui_hFigure); else gui_Handles = []; end if nargout [varargout{1:nargout}] = feval(gui_State.gui_OutputFcn, gui_hFigure, [], gui_Handles); else feval(gui_State.gui_OutputFcn, gui_hFigure, [], gui_Handles); end if isscalar(gui_hFigure) && ishghandle(gui_hFigure) set(gui_hFigure,'HandleVisibility', gui_HandleVisibility); end end function gui_hFigure = local_openfig(name, singleton, visible) % openfig with three arguments was new from R13. Try to call that first, if % failed, try the old openfig. if nargin('openfig') == 2 % OPENFIG did not accept 3rd input argument until R13, % toggle default figure visible to prevent the figure % from showing up too soon. gui_OldDefaultVisible = get(0,'defaultFigureVisible'); set(0,'defaultFigureVisible','off'); gui_hFigure = openfig(name, singleton); set(0,'defaultFigureVisible',gui_OldDefaultVisible); else gui_hFigure = openfig(name, singleton, visible); %workaround for CreateFcn not called to create ActiveX if feature('HGUsingMATLABClasses') peers=findobj(findall(allchild(gui_hFigure)),'type','uicontrol','style','text'); for i=1:length(peers) if isappdata(peers(i),'Control') actxproxy(peers(i)); end end end end function result = local_isInvokeActiveXCallback(gui_State, varargin) try result = ispc && iscom(varargin{1}) ... && isequal(varargin{1},gcbo); catch result = false; end function result = local_isInvokeHGCallback(gui_State, varargin) try fhandle = functions(gui_State.gui_Callback); result = ~isempty(findstr(gui_State.gui_Name,fhandle.file)) || ... (ischar(varargin{1}) ... && isequal(ishghandle(varargin{2}), 1) ... && (~isempty(strfind(varargin{1},[get(varargin{2}, 'Tag'), '_'])) || ... ~isempty(strfind(varargin{1}, '_CreateFcn'))) ); catch result = false; end