How to implement LIBSVM Matlab interface? - matlab

I am having problem with implementing LibSVM to MATLAB. I downloaded LibSVM package, libsvm-3.14 to my Windows 7 PC and tried to implement it, but I got this message:
"No supported SDK or compiler was found on this computer. For a list of supported compilers, see
http://www.mathworks.com/support/compilers/R2011a/win64.html
If make.m fails, please check README about detailed instructions."
The problem is yet not solved even after downloading the folder from this website: http://www.csie.ntu.edu.tw/~cjlin/libsvm/#matlab Is there another site where I could download that?

I am using libsvm from the site you mentioned - no problems.
Sounds like you don't have the Windows SDK installed.
You can install it from the link at http://www.mathworks.com.au/support/compilers/R2011a/win64.html
Another possibility is that you don't have mex setup.
You can check using mex.getCompilerConfigurations()
If not run: mex -setup
You might also need to install a c++ compiler - there is a link to get VC2010 expressed om the web page above.

Related

How to use OpenCV in Matlab?

I have looked at many resources. I just want a simple way to use the newest OpenCV with Matlab 2017a. MinGW doesn't work and a compiler but I can't seem to get Visual C++ working. I can use OpenCV in Visual Studio but what compiler does Matlab want from me and how do I obtain it?
There is a way to use opencv from matlab without compiling any mex files, and without using the computer vision toolbox.
You can call opencv through matlab via python commands.
1) Download and install the CPython distribution, not Anaconda
2) from the command prompt, install the opencv and other packages you want using the pip command > python -m pip install opencv-python
3) Follow the procedure in the matlab help for ensuring matlab knows where to look for the python installation
4) use the syntax py.cv2.function to call the opencv function
If you keep the data types as python data types in matlab while using the py.cv2 functions there isn't too much of a speed hit.
As #Miki mentions in the their comment, have you checked out this page on the MathWorks site? It has many resources, the main one is the Computer Vision System Toolbox OpenCV Interface. It comes with some examples which would be a good starting point. And if those aren't close to what you want, try another one of the community examples on the File Exchange and trying to make small changes to it.
For each version of MATLAB you can find the supported compilers in the documentation. You can also use -v flag as shown blow to see all the paths where MATLAB looks for a C++ compiler.
mex -setup -v

No supported SDK compiler found on this computer/LIBSVM

I try to install LIBSVM on a Windows 10 PC. Everytime I try to run the make file I get the following error:
No supported SDK or compiler was found on this computer.
For a list of supported compilers, see
http://www.mathworks.com/support/compilers/R2013b/win64.html
I have tried to install all supported compilers and non of them worked and I stil get the error message back. Also when I type mex -setup it says:"No supported SDK or compiler was found on this computer. "
I have read this question and several others: https://de.mathworks.com/matlabcentral/answers/100144-why-does-mex-not-find-the-microsoft-windows-sdk-7-1-installed-on-64-bit-windows-in-matlab-7-14-r201 and also tried to isntall the respective batch but as I said I am using Windows 10 not 7 and it gives me the respective error message. Moreover I have installed not only the compiler but also the .NET Framework 4. I have also installed the dependency walker and it does not show me any missing packages.
As you can possibly see from the question I am not an expert but I am searching for hours now and I get back the same error message again and again.Are there any suggestions how I could make LIBSVM work?
Thanks
Carlos
Cannot install Windows SDK 7.1 on Windows 10
That did the trick--in case anyone ever stumbles upon the same problem.

relating issues with mcc error & mbuild -setup settings for R2013b & deploytool for matlab

I try to make dll for vba in matlab using "deploytool" in matlab.
My environments are Matlab R2013b and VS2013.
I used bellow command to set the compiler
mbuild -setup
And I put the Visual studio 2013 as a compiler directory.
But deploytool is failed with below messages.
ant:
<ant>
<mkdir dir="C:\Program Files\MATLAB\R2013b\work\mymagic\for_redistribution" />
<mkdir dir="C:\Program Files\MATLAB\R2013b\work\mymagic\for_testing" />
mcc -W 'excel:mymagic,Class1,1.0' -T link:lib -b -d 'C:\Program
Files\MATLAB\R2013b\work\mymagic\for_testing' -v 'C:\Program
Files\MATLAB\R2013b\work\mymagic.m' 'class{Class1:C:\Program
Files\MATLAB\R2013b\work\mymagic.m}'
Test checkout of feature 'Compiler' failed.
mcc failed.
Also I checked lincese issues from other similar discussions.
Using !mcc and license('checkout','Compiler')
!mcc returns below error
Error: Could not check out a Compiler license:
Cannot find license file.
The license files (or license server system network addresses) attempted are
listed below. Use LM_LICENSE_FILE to use a different license file,
or contact your software provider for a license file.
Feature: Compiler
Filename: C:\Program Files\MATLAB\R2013b\licenses
License path: C:\Users\****1505\AppData\Roaming\MathWorks\MATLAB\R2013b_licenses;C:\Program Files\MATLAB\R2013b\licenses\license.dat;C:\Program Files\MATLAB\R2013b\licenses;
FLEXnet Licensing error:-1,359. System Error: 2 "No such file or directory"
For further information, refer to the FLEXnet Licensing documentation,
available at "www.flexerasoftware.com"..
But license('checkout','Compiler') gives me
ans = 1
I figure out one thing that matlab R2013b supports until Visual Studio 2012.
From below url.
http://kr.mathworks.com/support/compilers/R2013b/index.html?sec=win32
Should I install 2012 VS to use mcc in Matlab 2013 ?
Or is there any other methods to solve this problem
?
The similar question also doesn't get the proper answer.
Deploytool for MATLAB R2013b doesn't work, what has changed?
I will try below methods
http://de.mathworks.com/matlabcentral/answers/121413-error-using-mcc-test-checkout-of-feature-compiler-failed
Maybe the license for compiler is missing.
"mcc" command in matlab doesn't work.
So I will follow below
www.youtube.com/watch?v=PsKQ7loWZgU
Still it doesn't work
Firstly, the command "mcc" in matlab does't work
So, I try "mbuild -setup" again but it still gives same error messages.
The problem here was that, as I already mentioned in the question, Matlab 2013b doesn't comparable with the visual studio 2013.
So I downloaded SDK7 and .net framework 4 in below site
https://msdn.microsoft.com/ko-kr/vstudio/aa496123
https://www.microsoft.com/en-us/download/confirmation.aspx?id=8442
But choosing those options in "mbuild -setup" doesn't be resolved
I also try to download another package
https://www.microsoft.com/ko-kr/download/details.aspx?id=40784
still all failed
This is not an exact answer, just useful comments for this problem.
We can do 3 things to check our license for matlab compiler
license('checkout','Compiler')
!mcc
mcc
I think if we can pass those checking than we can use deploytool without any problems.
In my case, after activation of license it gives me an error, like,
Error: Could not check out a Compiler license:
SIGN= keyword required but missing from the license certificate.
This is probably because the license is older than the application
You need to obtain a SIGN= version of this license from your vendor.
Feature: Compiler
Missing: SIGN1=
License path: C:\Users\****1505\AppData\Roaming\MathWorks\MATLAB\R2013b_licenses;C:\Program Files\MATLAB\R2013b\licenses\license.dat;C:\Program Files\MATLAB\R2013b\licenses\license_****1505-PC_874166_R2013b.lic;
FLEXnet Licensing error:-114,582
For further information, refer to the FLEXnet Licensing documentation,
available at "www.flexerasoftware.com"..
So I might need to update my license to resolve this problem.
I simply change Matlab 2013 to 2014 version. It makes all fine
Also, I believe the reason for error was license issues.
After installing matlab 2014 I did below 3 things to make dll for vba
install MATLAB MCR
command
mcrinstaller
in matlab
install the generated file. In my case it was located in
C:\Program Files\MATLAB\R2014a\toolbox\compiler\deploy\win32\MCRInstaller.exe
allow macros in VBA from security center of Excel
Create VBA ADD IN using deploytool of Matlab

MATLAB Compiler

I use MATLAB 2012a. I need to compile a mex file in my program. Everything works fine with Microsoft SDK 7.1 but I need a minor compiler in order to work my program in other computers. Suggested compilers on MathWorks website are compilers that need to be installed as packages. Is there any compilers that work stand-alone and don't need to be installed?
You can use MinGW, but it is not straightforward. See this Q&A. The accepted answer suggest to compile and link MEX files outside of MATLAB, which is fine, but it's simple to just create mexopts.bat to do this.
A good mexopts.bat for MING is hosted here. Pick a MINGW distribution from win-builds and set the paths in mexopts. Then you can use mex -setup with this file.
gnumex is a disaster, IMO.

Error: Invalid MEX file, the specified module could not be found

I have compiled Mex file successfully on my laptop. But when I am running it, it says Invalid mex file 'c:\newfolder\filename.mexw32' The specified module could not be found.
System specification:
OS: windows 7
MATLAB 2010a
Microsoft Visual Studio 2008.
The same mex file is compiled and run successfully on my PC under XP SP3.
This MathWorks support link suggests two possible reasons to your problem:
You do not have all of the necessary libraries that the MEX-function is dependent upon.
You are running a MEX-file on a different version of MATLAB than it was compiled on.
Either way, to locate the source of this error it says that you need to list all dependent library files and verify their existence in the system you're trying to run the MEX file on, and also recommends the Dependecy Walker as the tool to to do that.
Do you you the mex file on another system than the one it is created on?
If so, then you need to install the Microsoft Visual C++ Redistributable on that machine.
I had this problem also when upgrading from Matlab2010a/VS2008 to Matlab2013a/VS2010.
All my environment variables were sent correctly.
A reboot fixed problems with OpenCV dlls not being found, I assume that it was still trying to link to the OpenCV dlls for VS2008 (even though I had changed the path). However still my mex file could not find libmex.dll.
When I installed Matlab2013a, I did not uninstall the old version (in case I wanted to go back).
However that was the cause of my problem.
Once I uninstalled the old version of Matlab and rebooted again, the problem was gone.
I had a similar problem. I was only linking against 1 'lib' so I simply copied that lib into the same folder as the mexw64 and it worked.
I have not poked around for the correct place to tell MATLAB to add the lib's real location to whatever path it's looking at.