之所以要把这个无聊的问题再次发帖,因为我怕以后我会忘记,我可以来论坛寻找,也因为这是使用libsvm的第一步(我在网上找了很久没有发现)
最关键的是compilers的选择(对于把Microsoft visual stdio 2005或者其他的编译器安装在自定义目录下的这一步非常关键) 以下是步骤:
>> mex -setup % 这是必须的
Please choose your compiler for building external interface (MEX) files:
Would you like mex to locate installed compilers [y]/n? n %这次是选择编译器,输入n,因为你的是自定义的
%出现下面的选项:
Select a compiler:
[1] Borland C++ Compiler (free command line tools) 5.5
[2] Borland C++Builder 6.0
[3] Borland C++Builder 5.0
[4] Compaq Visual Fortran 6.1
[5] Compaq Visual Fortran 6.6
[6] Intel C++ 9.1 (with Microsoft Visual C++ 2005 linker)
[7] Intel Visual Fortran 9.1 (with Microsoft Visual C++ 2005 linker)
[8] Intel Visual Fortran 9.0 (with Microsoft Visual C++ 2005 linker)
[9] Intel Visual Fortran 9.0 (with Microsoft Visual C++ .NET 2003 linker)
[10] Lcc-win32 C 2.4.1
[11] Microsoft Visual C++ 6.0
[12] Microsoft Visual C++ .NET 2003
[13] Microsoft Visual C++ 2005
[14] Microsoft Visual C++ 2005 Express Edition
[15] Open WATCOM C++ 1.3
[0] None
Compiler: 13%这次选择13,或许你也可以用其他的
The default location for Microsoft Visual C++ 2005 compilers is C:\Program Files\Microsoft Visual Studio 8,
but that directory does not exist on this machine.
Use C:\Program Files\Microsoft Visual Studio 8 anyway [y]/n? n %这次它说要使用默认的路径 继续选择n
Please enter the location of your compiler: [C:\Program Files\Microsoft Visual Studio 8] %它的意思是让你输入编译器的位置,输入: D:\Program Files\Microsoft Visual Studio 8
% 下面就是确认了
Please verify your choices:
Compiler: Microsoft Visual C++ 2005
Location: D:\Program Files\Microsoft Visual Studio 8
Are these correct?([y]/n): y
***************************************************************************
Warning: MEX-files generated using Microsoft Visual C++ 2005 require
that Microsoft Visual Studio 2005 run-time libraries be
available on the computer they are run on.
If you plan to redistribute your MEX-files to other MATLAB
users, be sure that they have the run-time libraries.
You can find more information about this at:
http://www.mathworks.com/support/solutions/data/1-2223MW.html
***************************************************************************
Trying to update options file: C:\Documents and Settings\Administrator\Application Data\MathWorks\MATLAB\R2007a\mexopts.bat
From template: D:\PROGRA~2\MATLAB\R2007a\bin\win32\mexopts\msvc80opts.bat
Done . . . % ok,done!
>> make
>>
%至此彻底完成,
%以下是测试
>>load heart_scale.mat
>>model = svmtrain(heart_scale_label, heart_scale_inst, '-c 1 -g 0.07');
>> [predict_label, accuracy, dec_values] = svmpredict(heart_scale_label, heart_scale_inst, model); %
Accuracy = 86.6667% (234/270) (classification)% done
最关键的是compilers的选择(对于把Microsoft visual stdio 2005或者其他的编译器安装在自定义目录下的这一步非常关键) 以下是步骤:
>> mex -setup % 这是必须的
Please choose your compiler for building external interface (MEX) files:
Would you like mex to locate installed compilers [y]/n? n %这次是选择编译器,输入n,因为你的是自定义的
%出现下面的选项:
Select a compiler:
[1] Borland C++ Compiler (free command line tools) 5.5
[2] Borland C++Builder 6.0
[3] Borland C++Builder 5.0
[4] Compaq Visual Fortran 6.1
[5] Compaq Visual Fortran 6.6
[6] Intel C++ 9.1 (with Microsoft Visual C++ 2005 linker)
[7] Intel Visual Fortran 9.1 (with Microsoft Visual C++ 2005 linker)
[8] Intel Visual Fortran 9.0 (with Microsoft Visual C++ 2005 linker)
[9] Intel Visual Fortran 9.0 (with Microsoft Visual C++ .NET 2003 linker)
[10] Lcc-win32 C 2.4.1
[11] Microsoft Visual C++ 6.0
[12] Microsoft Visual C++ .NET 2003
[13] Microsoft Visual C++ 2005
[14] Microsoft Visual C++ 2005 Express Edition
[15] Open WATCOM C++ 1.3
[0] None
Compiler: 13%这次选择13,或许你也可以用其他的
The default location for Microsoft Visual C++ 2005 compilers is C:\Program Files\Microsoft Visual Studio 8,
but that directory does not exist on this machine.
Use C:\Program Files\Microsoft Visual Studio 8 anyway [y]/n? n %这次它说要使用默认的路径 继续选择n
Please enter the location of your compiler: [C:\Program Files\Microsoft Visual Studio 8] %它的意思是让你输入编译器的位置,输入: D:\Program Files\Microsoft Visual Studio 8
% 下面就是确认了
Please verify your choices:
Compiler: Microsoft Visual C++ 2005
Location: D:\Program Files\Microsoft Visual Studio 8
Are these correct?([y]/n): y
***************************************************************************
Warning: MEX-files generated using Microsoft Visual C++ 2005 require
that Microsoft Visual Studio 2005 run-time libraries be
available on the computer they are run on.
If you plan to redistribute your MEX-files to other MATLAB
users, be sure that they have the run-time libraries.
You can find more information about this at:
http://www.mathworks.com/support/solutions/data/1-2223MW.html
***************************************************************************
Trying to update options file: C:\Documents and Settings\Administrator\Application Data\MathWorks\MATLAB\R2007a\mexopts.bat
From template: D:\PROGRA~2\MATLAB\R2007a\bin\win32\mexopts\msvc80opts.bat
Done . . . % ok,done!
>> make
>>
%至此彻底完成,
%以下是测试
>>load heart_scale.mat
>>model = svmtrain(heart_scale_label, heart_scale_inst, '-c 1 -g 0.07');
>> [predict_label, accuracy, dec_values] = svmpredict(heart_scale_label, heart_scale_inst, model); %
Accuracy = 86.6667% (234/270) (classification)% done