在這裡的網頁中注冊下載academic版本Matlab的PRtools模式識別工具箱,但是運行dd_tools中的oc_set函數會引用PRtools中的prtver函數,運行會出錯!
我下載下來的prtools_ac.zip中代碼修改日期為2011.10.11,根據2011.04.04版本的代碼直接修改prtver.m一點點即可!
- %PRTVER Get PRTools version
- %
- %This routine is intended for internal use in PRTools only
-
- function prtversion = prtver
-
- persistent PRTVERSION
- if ~isempty (PRTVERSION)
- prtversion = PRTVERSION;
- return
- end
-
- verstring = version;
- if strcmp(computer,'MAC2') | verstring(1) == '5';
- % name = fileparts(which('fisherc'))
- % [pp,name,ext] = fileparts(name(1:end-1))
- ver_struct.Name = 'Pattern Recognition Tools';
- ver_struct.Version = '4.0.0';
- ver_struct.Release = '';
- ver_struct.Date = '';
- prtversion = {ver_struct datestr(now)};
- else
- % [pp,name,ext] =fileparts(fileparts(which('fisherc')));
- % vers = ver([name,ext]);
- % if isempty(vers)
- % vers = 0;
- % error([newline 'This version of PRTools is not properly defined as a toolbox.' ...
- % newline 'Please add it first, e.g. using the addpath command with the path from root!'])
- % end
- % prtversion = {ver([name,ext]) datestr(now)};
- prtversion = {ver('prtools') datestr(now)};
- end
- PRTVERSION = prtversion;
把下面的語句注釋掉,而該語句上面的注釋符%去掉即可!
prtversion = {ver('prtools') datestr(now)};
但是奇怪的是,當運行成功後,我再次把原始2011.10.11的prtools_ac.zip放到toolsbox中居然不會運行出錯!!