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

📄 spath.m

📁 基于Matlab的SVM模式分类方法的实验系统,有仿真实验
💻 M
字号:
function stprpath(toolboxroot)
% STPRPATH sets path to Statistical Pattern Recognition Toolbox. 
%
% Synopsis:
%  stprpath
%  stprpath(toolboxroot)
%
% Description:
%  stprpath(toolboxroot) sets path to the toolbox stored in
%   given root directory toolboxroot.
%
%  stprpath takes the working directory as the root, i.e.,
%   toolboxroot=pwd.
%

% (c) Statistical Pattern Recognition Toolbox, (C) 1999-2003,
% Written by Vojtech Franc and Vaclav Hlavac,
% <a href="http://www.cvut.cz">Czech Technical University Prague</a>,
% <a href="http://www.feld.cvut.cz">Faculty of Electrical engineering</a>,
% <a href="http://cmp.felk.cvut.cz">Center for Machine Perception</a>



if nargin < 1
   toolboxroot=pwd;              % 获取当前目录
end

disp('已经为该系统的正常运行设置了如下的搜索路径:');

% 设置路径
p = ['$:',...                   % 当前目录
     '$svm:',...                % 当前目录的同级级目录
     '$Data:',...               % 当前目录的同级级目录
     '$test:',...
     '$help:',...
     '$test/LoadData:',...      % 当前目录的同级级目录以及同级目录的下级目录LoadData
     '$test/DrawGraph:',...
     '$../:',...;               % 当前目录的上级目录
     '$../../:']                % 当前目录的上上级目录
p=translate(p,toolboxroot);

addpath(p);                     % 增加搜索路径   



%--translate ---------------------------------------------------------
function p = translate(p,toolboxroot);
%TRANSLATE Translate unix path to platform specific path
%   TRANSLATE fixes up the path so that it's valid on non-UNIX platforms
%
% This function was derived from MathWork M-file "pathdef.m"

cname = computer;
% Look for VMS, this covers VAX_VMSxx as well as AXP_VMSxx.
%if (length (cname) >= 7) & strcmp(cname(4:7),'_VMS')
%  p = strrep(p,'/','.');
%  p = strrep(p,':','],');
%  p = strrep(p,'$toolbox.','toolbox:[');
%  p = strrep(p,'$','matlab:[');
%  p = [p ']']; % Append a final ']'

% 寻找PC
if strncmp(cname,'PC',2)               %比较cname的前两个字符是否是"PC"
  p = strrep(p,'/','\');               %替换p中的字符'/'为'\'
  p = strrep(p,':',';');
  p = strrep(p,'$',[toolboxroot '\']);

% 寻找MAC
elseif strncmp(cname,'MAC',3)
  p = strrep(p,':',':;');
  p = strrep(p,'/',':');
  m = toolboxroot;
  if m(end) ~= ':'
    p = strrep(p,'$',[toolboxroot ':']);
  else
    p = strrep(p,'$',toolboxroot);
  end
else
  p = strrep(p,'$',[toolboxroot '/']);
end

⌨️ 快捷键说明

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