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

📄 checkdat.m

📁 this a SVM toolbox,it is very useful for someone who just learn SVM.In order to be undestood easily,
💻 M
字号:
function [result]=checkdat(fname,ident,Nmask,Kmask)% CHECKDAT checks data format of given file.% [result]=checkdat(fname,ident,Nmask,Kmask)%% CHECKDAT checks if the file has the internal toolbox representation %  and complains to the data type determined by the input arguments.%% Input:%  fname [string] name of the file which is to be checked.%% Following arguments are optional:%  ident [string] data type identifier, see help dataid.%  Nmask [1x1] data dimension.%  Kmask [1xK] class sizes. %% Output:%  result [1x1] is 1 if file has internal toolbox representation and %    complains to the data type determined arguments else it returns 0.%% See DATAFILES.%% Statistical Pattern Recognition Toolbox, Vojtech Franc, Vaclav Hlavac% (c) Czech Technical University Prague, http://cmp.felk.cvut.cz% Written Vojtech Franc (diploma thesis) 02.01.2000% Modifications% 26-June-2001, V.Franc, comments repared.% 24. 6.00 V. Hlavac, comments polished.% 9-jan-2001, the comments extended% supported data files:FINITE_SETS=1;NORMAL_DISTRIB=2;% load fileload(fname);agree=0;% check mandatory variablesif exist('id')==1 & exist('I')==1 & exist('K')==1 & exist('N')==1,   agree=1;   % check input N dimension   if (Nmask>0 & Nmask~=N)      agree=0;   end   % check identifier   if strcmpi(ident,id)~=1,      agree=0;   end   % check Kmask and current K   if ~(max(size(Kmask)) == 1 & Kmask==0),      if max(size(Kmask))==max(size(K)) & min(size(Kmask)) == min(size(K)),         i=0;         while agree==1 & i < max(size(Kmask)),            i=i+1;            if Kmask(i)~=0 & Kmask(i)~=K(i),               agree=0;            end         end % while      else         agree=0;      end   end % sum(Kmask) > 0,   % if agree is still one than chek variables depending on current    % ident(ifier)   if agree==1,      if strcmpi(ident,dataid(FINITE_SETS))==1,         % finite sets, enumerated, must contain var. X with points         if exist('X')==0,            agree=0;         end      elseif strcmpi(ident,dataid(NORMAL_DISTRIB))==1,         % normal distributions, must contain vars. MI and SIGMA         if exist('MI')==0 | exist('SIGMA')==0,            agree=0;         end      else         agree=0;      end % elseif strcmpi(..   end % if agree==1,end % if exist('id')==1 & exist('I')==1 &...% set resultresult=agree;

⌨️ 快捷键说明

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