|
EDA365欢迎您登录!
您需要 登录 才可以下载或查看,没有帐号?注册
x
以下是步骤:6 T: ?( M# F; z6 ^8 G7 k
>> mex -setup % 这是必须的
4 p6 m) Q o0 n9 OPlease choose your compiler for building external inteRFace (MEX) files: 2 k; l( Y- s2 W$ ^- ]" O6 X
5 \- K% u- X$ d
Would you like mex to locate installed compilers [y]/n? n %这次是选择编译器,输入n,因为你的是自定义的" t3 q( h: a0 n5 x( j
%出现下面的选项:6 g) n6 R' I! T, r$ a) h
Select a compiler: # G* x% [: U/ ~5 I2 ]
[1] Borland C++ Compiler (free command line tools) 5.5 2 ?6 T8 y* J$ b$ D9 E& ~# H
[2] Borland C++Builder 6.0
7 f v- u i- Z' B5 r[3] Borland C++Builder 5.0
4 ^, n' {/ _, r[4] Compaq Visual Fortran 6.1 - I; E& m* \" N' l3 S& V+ `
[5] Compaq Visual Fortran 6.6 ! |7 V# _8 {0 Z% h' G5 k, |
[6] Intel C++ 9.1 (with Microsoft Visual C++ 2005 linker)
b a. u5 @! s5 N# e8 P- x[7] Intel Visual Fortran 9.1 (with Microsoft Visual C++ 2005 linker) $ ?* R$ M0 [8 ?4 h$ `
[8] Intel Visual Fortran 9.0 (with Microsoft Visual C++ 2005 linker)
; A& \/ {8 h8 d; D4 j[9] Intel Visual Fortran 9.0 (with Microsoft Visual C++ .NET 2003 linker) & k; F$ W- m# b3 Y9 C
[10] Lcc-win32 C 2.4.1
2 Y4 @9 y, z% z, |, b[11] Microsoft Visual C++ 6.0
# ^" D2 K; ^6 A[12] Microsoft Visual C++ .NET 2003
* O9 B/ X+ p* y; w. l- X0 e m5 Q[13] Microsoft Visual C++ 2005 ) @3 t: Q; u8 ^6 ^8 T
[14] Microsoft Visual C++ 2005 Express Edition 9 Q7 F8 Z$ }" j: l$ {, |
[15] Open WATCOM C++ 1.3
; o1 c# `" h% z2 E% t' R0 _ c: e y! Q4 I9 \' H' E, h
[0] None 7 C+ N1 G! ]0 `9 {5 s) G9 I7 L+ i
Compiler: 13%这次选择13,或许你也可以用其他的/ q& g- m. |% c0 G6 T
The default location for Microsoft Visual C++ 2005 compilers is C:\Program Files\Microsoft Visual Studio 8, ' j5 }) i( X9 Y: m+ P r4 O
but that directory does not exist on this machine.
( W1 {( E5 ^0 [$ M! o @' S
, x# A) b R1 a) O) `/ y2 e: n; pUse C:\Program Files\Microsoft Visual Studio 8 anyway [y]/n? n %这次它说要使用默认的路径 继续选择n* g& A, z0 e1 D6 I
Please enter the location of your compiler: [C:\Program Files\Microsoft Visual Studio 8] %它的意思是让你输入编译器的位置,输入:D:\Program Files\Microsoft Visual Studio 8! p: n# B0 S5 C- r# ]% I* Y+ Y5 K
% 下面就是确认了/ w* Y/ l: m {, {" C* x9 I
Please verify your choices:
, L# g* M: o; ]9 u1 z. O
; c! A8 D: e( i, NCompiler: Microsoft Visual C++ 2005
$ X+ a' k, [! c b; ~Location: D:\Program Files\Microsoft Visual Studio 8
4 t1 W- c8 B; ` q7 h/ \3 U9 N$ f8 [$ ?' S
Are these correct?([y]/n): y
$ R, I3 i( _. \5 Q- h***************************************************************************
4 S* T |7 s' ^: o5 l! S! i: K/ G' c Warning: MEX-files generated using Microsoft Visual C++ 2005 require 0 w8 J9 y N& @) Q
that Microsoft Visual Studio 2005 run-time libraries be
4 m' j9 j I1 T5 e available on the computer they are run on.
+ \9 v( Q" R6 \ If you plan to redistribute your MEX-files to other MATLAB ' ?4 k5 W G$ }) f4 q
users, be sure that they have the run-time libraries.
. \2 I0 r# o7 G; R) { You can find more information about this at: % `) A6 D" d" h& O* M" I. n8 t
- H8 s' B% z0 U8 P9 ~
*************************************************************************** + c5 X2 l! v+ L3 |* V# P
' g5 X2 @8 [- fTrying to update options file: C:\Documents and Settings\Administrator\Application Data\MathWorks\MATLAB\R2007a\mexopts.bat
' V- Q, s& O8 V1 w, j: kFrom template: D:\PROGRA~2\MATLAB\R2007a\bin\win32\mexopts\msvc80opts.bat . m y/ N2 o4 x- a9 u; T
3 R1 H" X: J5 [3 W) Z- c4 J) bDone . . . % ok,done!( q) J" @, w7 C* O# j; x& k
>> make
3 u7 _7 I9 \/ T/ m4 I4 T>>
( s D- W9 h- s" u( g%至此彻底完成,
: X1 X- r3 I. \, Q" ^( V( F0 C" i%以下是测试+ G/ W' c% `' Z: W
>>load heart_scale.mat* L; ?2 {4 S3 \5 o" p$ W
>>model = svmtrain(heart_scale_label, heart_scale_inst, '-c 1 -g 0.07');! l; A& R$ E' [2 r
>> [predict_label, accuracy, dec_values] = svmpredict(heart_scale_label, heart_scale_inst, model); %
9 I5 ~# _% e# o8 iAccuracy = 86.6667% (234/270) (classification)% done6 o$ A; [1 A+ d1 |+ Y9 G6 U
|
|