EDA365电子论坛网

标题: 是不是在找Matlab的libsvm的安装过程呢?这篇就是哦! [打印本页]

作者: piday123    时间: 2020-7-1 16:04
标题: 是不是在找Matlab的libsvm的安装过程呢?这篇就是哦!
以下是步骤:$ w4 C1 B. [, T" J/ x% l4 j
>> mex -setup % 这是必须的9 [& J4 n2 k8 b9 K* W6 o2 }, n0 k
Please choose your compiler for building external interface (MEX) files:
# B9 y$ N+ j" w. {
' P3 U; v5 t  u6 M( q* p3 _3 LWould you like mex to locate installed compilers [y]/n? n %这次是选择编译器,输入n,因为你的是自定义的/ K8 U) ?! Z* c  H4 ]; @" _
%出现下面的选项:
! o1 ?' {1 o$ r8 A+ USelect a compiler:
6 v- D, X  i7 s0 t4 G& c[1] Borland C++ Compiler (free command line tools) 5.5 6 H3 J# Q9 _$ t# f# R2 c
[2] Borland C++Builder 6.0 ' ^' ~' \4 `) V& `2 R* b+ J
[3] Borland C++Builder 5.0
- p% y7 \" K& j3 W% I" P+ X/ K[4] Compaq Visual Fortran 6.1
4 W, n6 W/ B0 z% h; y[5] Compaq Visual Fortran 6.6 3 F! w, W( _" K' N: O; i/ U
[6] Intel C++ 9.1 (with Microsoft Visual C++ 2005 linker) , o, u5 L' E, N; J7 ^+ D, [6 u
[7] Intel Visual Fortran 9.1 (with Microsoft Visual C++ 2005 linker) + M; A& u. X& R# ~: ]8 w$ |, O
[8] Intel Visual Fortran 9.0 (with Microsoft Visual C++ 2005 linker)
: ]  w$ s# |8 s[9] Intel Visual Fortran 9.0 (with Microsoft Visual C++ .NET 2003 linker)
0 \( E0 l' k8 ^; A; o/ x" u[10] Lcc-win32 C 2.4.1
& g2 t0 _( T: L( M7 l[11] Microsoft Visual C++ 6.0
5 Z1 W' L0 f, b" z5 P$ N' E& F[12] Microsoft Visual C++ .NET 2003
1 A  d+ M( q  u* o9 |[13] Microsoft Visual C++ 2005
( v& j" @) _0 D+ ]. L2 P[14] Microsoft Visual C++ 2005 Express Edition . S* |. H. [, ]; ]* O' a
[15] Open WATCOM C++ 1.3
+ C5 D  Q! W7 _/ _& d0 F; h7 J! C
/ R3 G6 h2 d% b, i8 h) B[0] None
" N, j; v: P9 z3 p- `: }, GCompiler: 13%这次选择13,或许你也可以用其他的
. H& J( n. R& B( X: D6 V! }" A* uThe default location for Microsoft Visual C++ 2005 compilers is C:\Program Files\Microsoft Visual Studio 8,
/ z. g/ g- d2 Y/ ^but that directory does not exist on this machine.  
. U# X* I# z2 o: Q4 j0 W; y8 I  i# b) D6 X7 B! `% L- Y7 @
Use C:\Program Files\Microsoft Visual Studio 8 anyway [y]/n? n %这次它说要使用默认的路径  继续选择n$ r. ^) ~7 o. M8 o: e
Please enter the location of your compiler: [C:\Program Files\Microsoft Visual Studio 8] %它的意思是让你输入编译器的位置,输入:D:\Program Files\Microsoft Visual Studio 8* _/ T% h2 f7 u+ v
% 下面就是确认了2 v8 f/ D+ T' b$ `9 o/ |
Please verify your choices:
8 Z6 a/ f4 u( Q; V9 m5 [) }$ d# g
; \# G; ]$ K( X7 q! q! R0 r3 k3 nCompiler: Microsoft Visual C++ 2005  
. c4 [; ~7 S4 Y) n. z- ]1 |Location: D:\Program Files\Microsoft Visual Studio 8
  V! x1 I% f! I  t9 Z  A2 ]: c1 O
Are these correct?([y]/n): y
  f9 R0 {8 H# d3 R*************************************************************************** " j3 M* Z; B8 E! r" g, q% y; _3 _
  Warning: MEX-files generated using Microsoft Visual C++ 2005 require & ~2 w* A2 N4 R3 N& g, |$ `+ d
           that Microsoft Visual Studio 2005 run-time libraries be  % W6 o: k% i0 |
           available on the computer they are run on.
4 t/ n' w, @1 a! w4 U- L           If you plan to redistribute your MEX-files to other MATLAB * @) T. z! v4 r* n7 Y
           users, be sure that they have the run-time libraries. * S4 M9 y. w4 }: N# h7 \5 B
           You can find more information about this at: 9 Y) K- v9 o% M) D, j  ^

, i' J9 z: C8 d' U  c*************************************************************************** 3 L* K& _3 z: c" a8 i2 N

0 F. s% ]  I% YTrying to update options file: C:\Documents and Settings\Administrator\Application Data\MathWorks\MATLAB\R2007a\mexopts.bat
3 N8 F1 z" ]5 o) }From template:              D:\PROGRA~2\MATLAB\R2007a\bin\win32\mexopts\msvc80opts.bat $ F. u2 O" c3 _  q1 `$ |
' Q4 Y( G4 T, a2 F- a% u5 k0 T
Done . . . %   ok,done!
/ D+ a: {7 Z0 q/ x* q: F/ ?>> make$ W/ `+ C& _' N* g2 g6 Y4 V3 d
>>
7 G, w9 O3 _4 e& X- U%至此彻底完成,( ~+ k9 S0 \, k$ R
%以下是测试
$ i: `% ]) {/ b2 e>>load heart_scale.mat
5 N  u) Q* u; V; D>>model = svmtrain(heart_scale_label, heart_scale_inst, '-c 1 -g 0.07');( m9 M% {# ^7 s+ E7 u$ D- y
>> [predict_label, accuracy, dec_values] = svmpredict(heart_scale_label, heart_scale_inst, model); %
3 ]9 b& \3 |0 k: q/ `2 A6 P% J9 Y+ ZAccuracy = 86.6667% (234/270) (classification)%  done
$ E0 o2 {. [. @& s+ U7 r8 T
作者: tend    时间: 2020-7-1 16:57
嗯嗯,找到了,就是这篇,谢谢!!!




欢迎光临 EDA365电子论坛网 (https://bbs.eda365.com/) Powered by Discuz! X3.2