⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 loadlayout.m

📁 常用ROBUST STATISTICAL
💻 M
字号:
function loadlayout
% This function will layout the gui controls. Eventually, this will be
% included in the complete function. Just have it now for simplicity.

% First get the user data from the root. See if anything is stored there.

ud = get(0,'userdata');

H.fig = figure('Tag','loadgui',...
    'position',[150 150 726 524],...
    'resize','off',...
    'toolbar','none',...
    'menubar','none',...
    'numbertitle','off',...
    'name','Load Data GUI',...
    'CloseRequestFcn','loadgui(''close'')');

if strcmp(version('-release'),'14')
    set(0,'DefaultUicontrolFontname','Sans Serif');
end

if ~isempty(ud)
    % Then something is there already. Add necessary handles to the
    % structure. 
    ud.guis = [ud.guis(:); H.fig];
else
    % Set the usual stuff and save in root.
    ud = userdata;
    set(0,'userdata',ud)
end

%%%%%%%  FRAMES %%%%%%%%%%%%%%%
% set up all of the frames first.
uicontrol(H.fig, 'style','frame',...
    'position',[50 366 616 103]);

uicontrol(H.fig, 'style','frame',...
    'position',[50 255 616 103]);

uicontrol(H.fig,'style','frame',...
    'position',[50 142 616 103]);

uicontrol(H.fig,'style','frame',...
    'position',[50 30 616 103]);

%%%%%%% TEXT BOXES %%%%%%%%%%%%%%
% set up all of the text boxes
uicontrol(H.fig,'style','text',...
    'position',[244 471 172 27],...
    'fontweight','bold',...
    'fontsize',14,...
    'backgroundcolor',[.8 .8 .8],...
    'string','Load Data')

uicontrol(H.fig,'style','text',...
    'position',[70 420 131 32],...
    'fontweight','bold',...
    'fontsize',10,...
    'horizontalalignment','left',...
    'string','Load Data Matrix:')

uicontrol(H.fig,'style','text',...
    'position',[70 314 175 32],...
    'fontweight','bold',...
    'fontsize',10,...
    'horizontalalignment','left',...
    'string','Load Case Labels (optional):')

uicontrol(H.fig,'style','text',...
    'position',[70 201 175 32],...
    'fontweight','bold',...
    'fontsize',10,...
    'horizontalalignment','left',...
    'string','Load Variable Labels (optional):')

uicontrol(H.fig,'style','text',...
    'position',[70 89 175 32],...
    'fontweight','bold',...
    'fontsize',10,...
    'horizontalalignment','left',...
    'string','Load Class Labels (optional):')

uicontrol(H.fig,'style','text',...
    'position',[82 380 400 30],...
    'horizontalalignment','left',...
    'string','The rows of the data matrix correspond to observations. The columns of the data matrix correspond to variables (dimensions).')

uicontrol(H.fig,'style','text',...
    'position',[82 273 400 30],...
    'horizontalalignment','left',...
    'string','These are labels for each row (observation) of the data matrix. The array can be numeric or a cell array of strings.')

uicontrol(H.fig,'style','text',...
    'position',[82 160 400 30],...
    'horizontalalignment','left',...
    'string','These are labels for each column (variable or dimension) of the data matrix. The array can be numeric or a cell array of strings.')

uicontrol(H.fig,'style','text',...
    'position',[82 47 400 30],...
    'horizontalalignment','left',...
    'string','These are class or group labels for the observations. Note that these can also be a variable in the data matrix, but they still have to be loaded separately here.')

%%%%%%% BUTTONS  %%%%%%%%%%%%%%%%%%%%   
uicontrol(H.fig,'style','pushbutton',...
    'position',[242 422 66 25],...
    'string','FROM FILE',...
    'tooltipstring','Push this button to load your data from a file.',...
    'callback','loadgui(''datafile'')')

uicontrol(H.fig,'style','pushbutton',...
    'position',[350 422 115 25],...
    'string','FROM WORKSPACE',...
    'tooltipstring','Push this button to load your data from a variable that is in the workspace.',...
    'callback','w = who; loadgui(''dataws'',w)')

uicontrol(H.fig,'style','pushbutton',...
    'position',[242 318 66 25],...
    'string','FROM FILE',...
    'tooltipstring','Push this button to load case labels from a file.',...
    'callback','loadgui(''caselabfile'')')

uicontrol(H.fig,'style','pushbutton',...
    'position',[350 318 115 25],...
    'string','FROM WORKSPACE',...
    'tooltipstring','Push this button to load case labels from a variable that is in the workspace.',...
    'callback','w = who; loadgui(''caselabws'',w)')

uicontrol(H.fig,'style','pushbutton',...
    'position',[242 205 66 25],...
    'string','FROM FILE',...
    'tooltipstring','Push this button to load variable labels from a file.',...
    'callback','loadgui(''varlabfile'')')

uicontrol(H.fig,'style','pushbutton',...
    'position',[350 205 115 25],...
    'string','FROM WORKSPACE',...
    'tooltipstring','Push this button to load variable labels from a variable that is in the workspace.',...
    'callback','w = who; loadgui(''varlabws'',w)')

uicontrol(H.fig,'style','pushbutton',...
    'position',[242 93 66 25],...
    'string','FROM FILE',...
    'tooltipstring','Push this button to load class labels from a file.',...
    'callback','loadgui(''classlabfile'')')

uicontrol(H.fig,'style','pushbutton',...
    'position',[350 93 115 25],...
    'string','FROM WORKSPACE',...
    'tooltipstring','Push this button to load class labels from a variable that is in the workspace.',...
    'callback','w = who; loadgui(''classlabws'',w)')

uicontrol(H.fig,'style','pushbutton',...
    'position',[600 485 66 25],...
    'string','CLOSE',...
    'callback','loadgui(''close'')',...
    'tooltipstring','Push this button to close the GUI window.')

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -