Configure libsvm in MATLAB to prevent memo

Source: Internet
Author: User
Tags visual studio 2010

1. First, we need to download a libsvm toolbox, which can be downloaded everywhere.

2. decompress the compressed package. I decompress the package to c: \ Users \ Administrator \ Desktop \ libsvm on the desktop.

3. Open MATLAB and locate it under the following directory:

4. Enter the following code according to the process:

> Mex-Setup
 
Welcome to Mex-setup. This utility will help you set up
A default compiler. For a list of supported compilers, see
Http://www.mathworks.com/support/compilers/R2012b/win64.html
 
Please choose your compiler for building Mex-files:
 
Wocould you like Mex to locate installed compilers [y]/n? N
 
Select a compiler:
[1] intel C ++ 12.0 (with Microsoft software development kit (SDK) linker)
[2] intel C ++ 12.0 (with Microsoft Visual C ++ 2008 SP1 linker)
[3] intel C ++ 12.0 (with Microsoft Visual C ++ 2010 linker)
[4] intel C ++ 11.1 (with Microsoft Visual C ++ 2008 SP1 linker)
[5] intel Visual Fortran 12 (with Microsoft software development kit (SDK) linker)
[6] intel Visual Fortran 12.0 (with Microsoft Visual C ++ 2008 SP1 linker)
[7] intel Visual Fortran 12.0 (with Microsoft Visual C ++ 2008 shell linker)
[8] intel Visual Fortran 12.0 (with Microsoft Visual C ++ 2010 linker)
[9] intel Visual Fortran 11.1 (with Microsoft Visual C ++ 2008 SP1 linker)
[10] intel Visual Fortran 11.1 (with Microsoft Visual C ++ 2008 shell linker)
[11] Microsoft software development kit (SDK) 7.1
[12] Microsoft Visual C + + 2005 SP1
[13] Microsoft Visual C + + 2008 SP1
[14] Microsoft Visual C + + 2010
 
[0] None
 
Compiler: 14
 
Your machine has a Microsoft Visual C ++ 2010 compiler located
D: \ vs2010 install. Do you want to use this compiler [y]/n? Y
 
Please verify your choices:
 
Compiler: Microsoft Visual C + + 2010
Location: D: \ vs2010 Installation
 
Are these correct [y]/n? Y
 
**************************************** ***********************************
Warning: Mex-files generated using Microsoft Visual C ++ 2010 require
That Microsoft Visual Studio 2010 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.
**************************************** ***********************************
 
 
Trying to update options file: C: \ Users \ Administrator \ appdata \ roaming \ Mathworks \ MATLAB \ r2012b \ mexopts. bat
From template: C: \ progra ~ 1 \ MATLAB \ r2012b \ bin \ win64 \ mexopts \ msvc100opts. bat
 
Done...
 
**************************************** **********************************
Warning: the matlab c and fortran api has changed to support MATLAB
Variables with more than 2 ^ 32-1 elements. In the near future
You will be required to update your code to utilize the new
Api. You can find more information about this:
Http://www.mathworks.com/help/techdoc/matlab_external/bsflnue-1.html
Building with the-largearraydims option enables the new API.
**************************************** **********************************
 
> 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)

If the data in the dataset can be loaded and displayed in red, we can think that the configuration is complete.

It should be noted that the absolute address of the folder after installation should not be moved as much as possible, or an error may be reported when the folder is run again...

Note: the blue part is the code that we need to manually enter. The last line of red is the final output.

In this way, other excellent posts on the MATLAB forum can be viewed.

1 http://www.ilovematlab.cn/thread-35262-1-1.html

2 http://www.ilovematlab.cn/thread-61234-1-1.html

3 http://www.ilovematlab.cn/thread-50032-1-1.html

Configure libsvm in MATLAB to prevent memo

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.