|
EDA365欢迎您登录!
您需要 登录 才可以下载或查看,没有帐号?注册
x
以下是步骤:1 P6 |: u: x& u- i$ U3 G% o. K7 }
>> mex -setup % 这是必须的9 b& K7 N, g. n2 O
Please choose your compiler for building external inteRFace (MEX) files:
0 D8 r% o$ ?. ~: ]( c, h+ c& D1 R* l$ s5 X9 F+ S7 [
Would you like mex to locate installed compilers [y]/n? n %这次是选择编译器,输入n,因为你的是自定义的
0 m( S- i8 [) F5 f' H%出现下面的选项:1 U( h4 D: v% {! }5 y
Select a compiler:
( g" i5 Y( J. q[1] Borland C++ Compiler (free command line tools) 5.5
" L' G# S5 Y- X[2] Borland C++Builder 6.0 " T1 z0 K. W. N: R) P2 Q
[3] Borland C++Builder 5.0
' N( a- {% U; m2 {" J4 T* g2 U[4] Compaq Visual Fortran 6.1
( I4 E5 \! C. X) |' y$ u& X6 e[5] Compaq Visual Fortran 6.6
, h. W% v& m S, b# z. i[6] Intel C++ 9.1 (with Microsoft Visual C++ 2005 linker)
6 \3 C0 B; g9 n: z3 w[7] Intel Visual Fortran 9.1 (with Microsoft Visual C++ 2005 linker)
/ @2 P; O" o3 P3 l: [& Y: u6 g[8] Intel Visual Fortran 9.0 (with Microsoft Visual C++ 2005 linker)
; k3 F- C- t2 L g9 ^4 K2 E[9] Intel Visual Fortran 9.0 (with Microsoft Visual C++ .NET 2003 linker) 2 X; l* p. U- w! S% m& D2 c( x
[10] Lcc-win32 C 2.4.1
& R6 l+ d; p# w5 ^5 G[11] Microsoft Visual C++ 6.0
: w8 P. I4 I$ e: A; X[12] Microsoft Visual C++ .NET 2003
* u7 G; {' }# l[13] Microsoft Visual C++ 2005
# i. p- m D5 j. Y3 V# l" U[14] Microsoft Visual C++ 2005 Express Edition
N2 W- d3 y- ^[15] Open WATCOM C++ 1.3
+ V5 Y4 G% ?' W9 {3 f B
) U* K1 i, o8 x; Z7 {0 X/ v, t, J[0] None ; u; U/ U |6 R! v
Compiler: 13%这次选择13,或许你也可以用其他的
, g- o, B h/ MThe default location for Microsoft Visual C++ 2005 compilers is C:\Program Files\Microsoft Visual Studio 8, 6 F! B2 I& v8 I, r! f' U
but that directory does not exist on this machine. " \: p( Q- m6 I! u, _& K
- V) a% w4 f/ PUse C:\Program Files\Microsoft Visual Studio 8 anyway [y]/n? n %这次它说要使用默认的路径 继续选择n
. t1 C- y" k/ Q" i4 sPlease enter the location of your compiler: [C:\Program Files\Microsoft Visual Studio 8] %它的意思是让你输入编译器的位置,输入:D:\Program Files\Microsoft Visual Studio 81 W( u0 H9 {# t( V/ J L' x
% 下面就是确认了
3 d. A. s+ A7 cPlease verify your choices: , R' I0 {! @7 V6 d" I1 u, t+ J0 G
6 L6 n: T& |# }/ Z* ?" ^6 K3 N, w" CCompiler: Microsoft Visual C++ 2005
$ ]: M7 z( M4 u6 D3 |4 O& F7 ?! p6 zLocation: D:\Program Files\Microsoft Visual Studio 8
+ P. q; ^# l& l; S" {1 H* m& b! p3 Q V5 t& s
Are these correct?([y]/n): y. G' u2 K& M# W, u1 D! I) Q
***************************************************************************
5 q8 m& V5 b, ?# ~$ P6 J- W2 { Warning: MEX-files generated using Microsoft Visual C++ 2005 require
5 t: R: G* B" Z. i4 M that Microsoft Visual Studio 2005 run-time libraries be
* R6 K* A# z, i8 I/ W6 i1 \5 p available on the computer they are run on. ) z: @6 W6 j1 C$ l
If you plan to redistribute your MEX-files to other MATLAB 2 O0 m1 P; k- o; O' ?3 `$ S
users, be sure that they have the run-time libraries. : D2 Y: k* e# }2 z/ z
You can find more information about this at: + m5 z5 |! r( y- v2 T
: X T4 v4 A8 U: j8 `8 w2 I( b' r* T
***************************************************************************
# X) t9 g) o& V* o: l6 `
7 g+ N' W: {3 G1 J/ pTrying to update options file: C:\Documents and Settings\Administrator\Application Data\MathWorks\MATLAB\R2007a\mexopts.bat
3 H) `) W; x: \& Z q7 \( A% GFrom template: D:\PROGRA~2\MATLAB\R2007a\bin\win32\mexopts\msvc80opts.bat 0 J0 ^! Z( L" }( F3 z8 M0 b
2 q' C- G) ]0 S/ y! O5 a5 \/ s$ R
Done . . . % ok,done!
! L( {! C) H9 g- Z. N1 W9 `( U>> make7 E" Y3 |" Y8 R0 E. J
>> 6 C4 ?& e1 s$ n
%至此彻底完成,; o1 p/ F+ v4 K" S& r1 x
%以下是测试( G1 t* U* P% a. w& }1 i
>>load heart_scale.mat
3 B! O0 w, ], J2 v>>model = svmtrain(heart_scale_label, heart_scale_inst, '-c 1 -g 0.07');
`0 o2 `. i) i, ], d>> [predict_label, accuracy, dec_values] = svmpredict(heart_scale_label, heart_scale_inst, model); %
' k0 n7 f& O. k" @# J' m& T# uAccuracy = 86.6667% (234/270) (classification)% done
! B3 m* z4 o$ B |
|