classifier.m

来自「最新的模式识别分类工具箱,希望对朋友们有用!」· M 代码 · 共 708 行 · 第 1/2 页

M
708
字号
	'BackgroundColor',[0.8 0.8 0.8], ...	'HorizontalAlignment','left', ...	'ListboxTop',0, ...	'Position',[20 428 50 15], ...	'String','File name: ', ...	'Style','text', ...	'Tag','StaticText1');% Typein widget for the File nameh1 = uicontrol('Parent',h0, ...	'Units','points', ...	'BackgroundColor',[1 1 1], ...	'Callback','classifier_commands(''FileNameInput'')', ...	'HorizontalAlignment','left', ...	'ListboxTop',0, ...	'Position',[50 428 120 18], ...	'Style','edit', ...	'Tag','FileNameInput');% 0.752941176470588 0.752941176470588], ...h1 = uicontrol('Parent',h0, ...	'Units','points', ...	'BackgroundColor',[0.8,0.8,0.8],...	'Callback','classifier_commands(''SearchForFile'')', ...	'ListboxTop',0, ...	'Position',[173 428 18 18], ...	'String','...', ...	'Tag','pshLocateFile');% ================================================% Box 4, below Box 3h1 = uicontrol('Parent',h0, ...	'Units','points', ...	'BackgroundColor',[0.8 0.8 0.8], ...	'ListboxTop',0, ...	'Position',[16 218 180 200], ...	'Style','frame', ...	'Tag','frmParameters');% "Error Estimation Method" in box 4% this is the texth1 = uicontrol('Parent',h0, ...	'Units','points', ...	'BackgroundColor',[0.8 0.8 0.8], ...	'HorizontalAlignment','left', ...	'ListboxTop',0, ...	'Position',[18 395 80 15], ...	'String','Error estimation:', ...	'Style','text', ...	'Tag','txtRedrawingmethod1');% and this is the pop up menuh1 = uicontrol('Parent',h0, ...	'Units','points', ...	'BackgroundColor',[.8 .8 .8],...	'ListboxTop',0, ...	'Position',[95 395 95 18], ...	'String',mat5, ...	'Style','popupmenu', ...	'Tag','popErrorEstimationMethod', ...	'Value',1);% "Number of redraws" control, in Box 4% this is the text for it%  'Position',[18.75 343.75 69.75 15], ...h1 = uicontrol('Parent',h0, ...	'Units','points', ...	'BackgroundColor',[0.8 0.8 0.8], ...	'HorizontalAlignment','left', ...	'ListboxTop',0, ...	'Position',[18 375 100 15], ...	'String','Number of redraws: ', ...	'Style','text', ...	'Tag','StaticText1');% and this is the Typein Widgeth1 = uicontrol('Parent',h0, ...	'Units','points', ...	'BackgroundColor',[1 1 1], ...	'Callback','                 ', ...	'ListboxTop',0, ...	'Position',[110 375 70 16], ...	'String','1', ...	'Style','edit', ...	'Tag','Redraws');% "Percentage of training vectors" in Box 4%  this is the texth1 = uicontrol('Parent',h0, ...	'Units','points', ...	'BackgroundColor',[0.8 0.8 0.8], ...	'HorizontalAlignment','left', ...	'ListboxTop',0, ...	'Position',[18  360 120 15], ...	'String','Precentage of training vectors: ', ...	'Style','text', ...	'Tag','StaticText1');% and this is the typein widgeth1 = uicontrol('Parent',h0, ...	'Units','points', ...	'BackgroundColor',[1 1 1], ...	'Callback','                           ', ...	'ListboxTop',0, ...	'Position',[140 360 40 16], ...	'String','20', ...	'Style','edit', ...	'Tag','PercentTraining');    % --------------------------------% "Preprocessing" control in Box 4% this is the texth1 = uicontrol('Parent',h0, ...	'Units','points', ...	'BackgroundColor',[0.8 0.8 0.8], ...	'ListboxTop',0, ...	'Position',[18 310 176 50], ...	'Style','frame', ...	'Tag','frmParameters');h1 = uicontrol('Parent',h0, ...	'Units','points', ...	'BackgroundColor',[0.8 0.8 0.8], ...	'HorizontalAlignment','center', ...	'ListboxTop',0, ...	'Position',[20 343 170 15], ...	'String','Preprocessing: ', ...	'Style','text', ...	'Tag','StaticText2');% and this is the typein widget% Position',[87 304.75 87.75 15], ...h1 = uicontrol('Parent',h0, ...	'Units','points', ...	'BackgroundColor',[0.752941176470588 0.752941176470588 0.752941176470588], ...	'Callback','classifier_commands(''Changed Preprocessing'')', ...	'ListboxTop',0, ...	'Position',[20 330 170 15], ...	'String',mat3, ...	'Style','popupmenu', ...	'Tag','Preprocessing', ...	'Value',1);% These are the normally hidden boxes for the%  preprocessing parametersh1 = uicontrol('Parent',h0, ...	'Units','points', ...	'BackgroundColor',[0.8 0.8 0.8], ...	'HorizontalAlignment','center', ...	'ListboxTop',0, ...	'Position',[20 315 110 15], ...	'Style','text', ...	'Tag','lblPreprocessingParameters');h1 = uicontrol('Parent',h0, ...	'Units','points', ...	'BackgroundColor',[1 1 1], ...	'ListboxTop',0, ...	'Position',[140 315 50 15], ...	'Style','edit', ...	'Tag','txtPreprocessingParameters', ...	'Visible','off');% --------------------------------% Classification "Algorithm" in box 4% this is the text for it% First a boxh1 = uicontrol('Parent',h0, ...	'Units','points', ...	'BackgroundColor',[0.8 0.8 0.8], ...	'ListboxTop',0, ...	'Position',[18 250 176 66], ...	'Style','frame', ...	'Tag','frmParameters');h1 = uicontrol('Parent',h0, ...	'Units','points', ...	'BackgroundColor',[0.8 0.8 0.8], ...	'HorizontalAlignment','center', ...	'ListboxTop',0, ...	'Position',[20 300 170 15], ...	'String','Algorithm: ', ...	'Style','text', ...	'Tag','StaticText1');% and this is the popup menu h1 = uicontrol('Parent',h0, ...	'Units','points', ...	'BackgroundColor',[.8 .8 .8],...	'Callback','classifier_commands(''Changed Algorithm'')', ...	'ListboxTop',0, ...	'Position',[20 285 170 16], ...	'String',mat4, ...	'Style','popupmenu', ...	'Tag','Algorithm', ...	'Value',5);% These are the parametersh1 = uicontrol('Parent',h0, ...	'Units','points', ...	'BackgroundColor',[0.8 0.8 0.8], ...	'HorizontalAlignment','left', ...	'ListboxTop',0, ...	'Position',[20 268 125 15], ...	'Style','text', ...	'Tag','lblAlgorithmParameters');h1 = uicontrol('Parent',h0, ...	'Units','points', ...	'BackgroundColor',[1 1 1], ...	'ListboxTop',0, ...	'Position',[150 268 40 16], ...	'Style','edit', ...	'Tag','txtAlgorithmParameters', ...	'Visible','off');h1 = uicontrol('Parent',h0, ...	'Units','points', ...	'BackgroundColor',[1 1 1], ...	'ListboxTop',0, ...	'Position',[20 254 170 16], ...	'Style','edit', ...	'Tag','txtAlgorithmParametersLong', ...	'Visible','off');% These are for manually entering distributions..% The main frameh1 = uicontrol('Parent',h0, ...	'Units','points', ...	'BackgroundColor',[0.8 0.8 0.8], ...	'ListboxTop',0, ...	'Position',[16.5 92.25 161.25 121.75], ...	'Style','frame', ...	'Tag','frmDistInput');% The control manually enter distributionh1 = uicontrol('Parent',h0, ...	'Units','points', ...	'BackgroundColor',[0.752941176470588 0.752941176470588 0.752941176470588], ...	'Callback','classifier_commands(''EnterManualDist'')', ...	'HorizontalAlignment','center', ...	'ListboxTop',0, ...	'Position',[22.5 194.75 150 16.5], ...	'String','Manually enter distributions', ...	'Tag','pshManual');% The control: Load Distribution Parametersh1 = uicontrol('Parent',h0, ...	'Units','points', ...	'BackgroundColor',[0.752941176470588 0.752941176470588 0.752941176470588], ...	'Callback','classifier_commands(''LoadDistFile'')', ...	'ListboxTop',0, ...	'Position',[22.5 176.75 150 16.5], ...	'String','Load distribution parameters', ...	'Tag','pshloadDistribution');% The control: Generate Sample Datah1 = uicontrol('Parent',h0, ...	'Units','points', ...	'BackgroundColor',[0.752941176470588 0.752941176470588 0.752941176470588], ...	'Callback','classifier_commands(''GenerateDistData'')', ...	'ListboxTop',0, ...	'Position',[22.5 158 150 16.5], ...	'String','Generate a sample data set', ...	'Tag','pshGenerateData');% The control: "Graphically Enter A Data Set"h1 = uicontrol('Parent',h0, ...	'Units','points', ...	'BackgroundColor',[0.752941176470588 0.752941176470588 0.752941176470588], ...	'Callback','classifier_commands(''ManualGraphData'')', ...	'HorizontalAlignment','center', ...	'ListboxTop',0, ...	'Position',[22.5 140 150 16.5], ...	'String','Graphically enter a data set', ...	'Tag','pshGraphData');% control: number of points per click%  the texth1 = uicontrol('Parent',h0, ...	'Units','points', ...	'BackgroundColor',[0.8 0.8 0.8], ...	'HorizontalAlignment','left', ...	'ListboxTop',0, ...	'Position',[22.5 114.5 146.25 17.25], ...	'Style','text', ...	'String','Number of points per click:', ...	'Tag','lblNumberofManualPoints');% the typein widgeth1 = uicontrol('Parent',h0, ...	'Units','points', ...	'BackgroundColor',[1 1 1], ...	'Callback','                           ', ...	'ListboxTop',0, ...	'Position',[143.25 118.5 29.5 15.75], ...	'String','20', ...	'Style','edit', ...	'Tag','txtNumberPointsPerClick');% The control: display bayes decision boundaries:%  a checkbox% 'Position',[22.5 94.5 146.25 17.25], ...h1 = uicontrol('Parent',h0, ...	'Units','points', ...	'BackgroundColor',[0.8 0.8 0.8], ...	'Callback',mat6, ...	'ListboxTop',0, ...	'Position',[22.5 94.5 150.25 17.25], ...	'String','Show Bayes decis. boundary', ...	'Style','checkbox', ...	'Tag','chkBayes', ...	'Value',1);% Four buttons: Compare, Params, % h1 = uicontrol('Parent',h0, ...	'Units','points', ...	'BackgroundColor',[0.752941176470588 0.752941176470588 0.752941176470588], ...	'Callback',mat7, ...	'ListboxTop',0, ...	'Position',[15 59.25 45 27.75], ...	'String','Compare', ...	'Tag','MultiAlgorithms');h1 = uicontrol('Parent',h0, ...	'Units','points', ...	'BackgroundColor',[0.752941176470588 0.752941176470588 0.752941176470588], ...	'Callback','classifier_commands(''Params'')', ...	'ListboxTop',0, ...	'Position',[61 59.25 45 27.75], ...	'String','Params', ...	'Tag','Parameters');h1 = uicontrol('Parent',h0, ...	'Units','points', ...	'BackgroundColor',[0.752941176470588 0.752941176470588 0.752941176470588], ...	'Callback','classifier_commands(''ClearBounds'')', ...	'ListboxTop',0, ...	'Position',[107 59.25 45 27.75], ...	'String','Clear', ...	'Tag','Clear');h1 = uicontrol('Parent',h0, ...	'Units','points', ...	'BackgroundColor',[0.752941176470588 0.752941176470588 0.752941176470588], ...	'Callback',mat8, ...	'FontWeight','bold', ...	'ListboxTop',0, ...	'Position',[153 59.25 45 27.75], ...	'String','Start', ...	'Tag','Start');% ================================================================% I do not know what the following are.if nargout > 0, fig = h0; endclassifier_commands('Init');

⌨️ 快捷键说明

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