|
|
EDA365欢迎您登录!
您需要 登录 才可以下载或查看,没有帐号?注册
x
以下是步骤:4 r/ c* ^$ F' d# h
>> mex -setup % 这是必须的: l+ c$ U6 p# G. }4 r; K; o
Please choose your compiler for building external inteRFace (MEX) files: ) W3 P ~7 y/ P
. m7 p0 |% i. NWould you like mex to locate installed compilers [y]/n? n %这次是选择编译器,输入n,因为你的是自定义的
8 K% E N- b, G! w- R7 B0 U% H1 x1 t' t%出现下面的选项:
" T4 e9 ^5 V+ e% @5 \Select a compiler: * r, b. z1 `+ T5 T I6 o
[1] Borland C++ Compiler (free command line tools) 5.5
7 F2 B+ S7 t0 w3 i' H& \/ n7 P( ?[2] Borland C++Builder 6.0 8 _; D) y9 R1 j: h& w
[3] Borland C++Builder 5.0 . U( K1 m4 j, Y/ G2 V5 ^
[4] Compaq Visual Fortran 6.1
4 Q% K/ D- N6 b8 e[5] Compaq Visual Fortran 6.6 $ d, O5 ^8 R: N/ o; n3 c
[6] Intel C++ 9.1 (with Microsoft Visual C++ 2005 linker) ' e. w9 L# m: K, ]& G, Y i
[7] Intel Visual Fortran 9.1 (with Microsoft Visual C++ 2005 linker)
9 q$ F- e7 `& V w2 Q[8] Intel Visual Fortran 9.0 (with Microsoft Visual C++ 2005 linker)
7 B$ \; l2 o8 p4 R* h `9 q$ v[9] Intel Visual Fortran 9.0 (with Microsoft Visual C++ .NET 2003 linker) ( ?4 ?9 ?+ g& W& h% j, q$ R
[10] Lcc-win32 C 2.4.1 . b5 `. ^% ?5 Q% O% p2 k
[11] Microsoft Visual C++ 6.0
$ k- Y, Q* r: W( ][12] Microsoft Visual C++ .NET 2003
) N8 W4 p6 M5 ]: J( ?5 ?& y[13] Microsoft Visual C++ 2005
5 P* r/ a3 g$ O% x% x" W O/ A[14] Microsoft Visual C++ 2005 Express Edition
8 e7 @0 j, B# p) i$ A0 S4 M[15] Open WATCOM C++ 1.3
2 p, i* L# D$ T7 T* h
$ H2 g+ K6 \9 a# }; T[0] None
; |. O& v- P: tCompiler: 13%这次选择13,或许你也可以用其他的! v' y0 e! |5 F4 }
The default location for Microsoft Visual C++ 2005 compilers is C:\Program Files\Microsoft Visual Studio 8, ! _, t: w, K3 q5 v
but that directory does not exist on this machine.
9 Y# c4 D+ B4 P- r3 L, G3 R$ \* V, d, ?( K- X' X. E" C
Use C:\Program Files\Microsoft Visual Studio 8 anyway [y]/n? n %这次它说要使用默认的路径 继续选择n
7 c9 P( @) r |Please enter the location of your compiler: [C:\Program Files\Microsoft Visual Studio 8] %它的意思是让你输入编译器的位置,输入:D:\Program Files\Microsoft Visual Studio 8
) t3 x# E0 d, K+ W% 下面就是确认了
5 ?$ b" E* r( d4 D7 b' W e& k! HPlease verify your choices: 2 b' t& j/ a8 c5 B5 L5 i
9 F7 w; Q; [: Y1 N: ?9 I
Compiler: Microsoft Visual C++ 2005 M* S! K7 a) M/ r
Location: D:\Program Files\Microsoft Visual Studio 8 2 O% f& u. q2 J0 `) d
% G* K& F4 K: }3 }0 E
Are these correct?([y]/n): y
) A' _$ i8 Y7 u; F***************************************************************************
7 ]( t! K- S7 G0 R4 `" q% b Warning: MEX-files generated using Microsoft Visual C++ 2005 require ; |# w" w$ ], c1 B
that Microsoft Visual Studio 2005 run-time libraries be 1 @! s6 D7 l: C2 ~9 e
available on the computer they are run on. 5 o3 |: h* w: e/ L: L
If you plan to redistribute your MEX-files to other MATLAB ' r( m/ {+ Y! U" L
users, be sure that they have the run-time libraries.
& _1 m2 F' f7 {& U( L/ q You can find more information about this at:
8 v9 B* c7 ^ P% H+ T. Q) V6 v0 E4 J6 x
*************************************************************************** ) r- L9 h3 B7 v: ?5 I, S1 ^) r
, O9 c7 {) i* p! Q, H' L
Trying to update options file: C:\Documents and Settings\Administrator\Application Data\MathWorks\MATLAB\R2007a\mexopts.bat
, h8 f u" r. o z* u+ i0 LFrom template: D:\PROGRA~2\MATLAB\R2007a\bin\win32\mexopts\msvc80opts.bat
- _- h0 Z" Z. [+ }* e. U: H) b4 D
7 u: v9 H+ S5 Z$ w2 g6 xDone . . . % ok,done!7 w8 A0 S9 |: z; ?. i, @- `3 i
>> make
# S( }! V3 J+ Y1 H>> # } m" f; A: _0 X+ j
%至此彻底完成,' ?& q2 X6 p. ^* s0 Q
%以下是测试
7 E \- [* _; x5 m9 F; p$ G>>load heart_scale.mat
, k" U' P6 [) |; _/ g>>model = svmtrain(heart_scale_label, heart_scale_inst, '-c 1 -g 0.07');
6 G' W3 ^' L) q {9 q: J>> [predict_label, accuracy, dec_values] = svmpredict(heart_scale_label, heart_scale_inst, model); %
2 [+ d- x3 Z6 b# C4 \/ NAccuracy = 86.6667% (234/270) (classification)% done+ X# n I) P# o) j1 }& f4 K
|
|