I want to provide a step by step troubleshooting to a problem I'm having. I would like to use the toolbox found at http://www.cs.man.ac.uk/~gbrown/fstoolbox/ for a variety of uses in my research being carried out in Matlab R2012a 32 bit. Here is the error I see in Matlab when using the 'CompileFeat.m' script that must be called to compile the main toolbox functions designed in C. Of course I copy the unzipped folder into my current working path, and add all folders to the current working path.

>> CompileFEAST

  C:\PROGRA~2\MATLAB\R2012A\BIN\MEX.PL: Error: 'FSToolboxMex.c' not found. 

Error using mex (line 206)
Unable to complete successfully.

Error in CompileFEAST (line 3)
mex -I../MIToolbox FSToolboxMex.c BetaGamma.c CMIM.c CondMI.c DISR.c ICAP.c JMI.c
mRMR_D.c ../MIToolbox/MutualInformation.c ../MIToolbox/Entropy.c
../MIToolbox/CalculateProbability.c ../MIToolbox/Arr 

So after some digging on Google, I've seen many suggestions asking me to check if I have a compiler installed. Please see code below:

>> 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/R2012a/win32.html 

Please choose your compiler for building MEX-files: 

Would you like mex to locate installed compilers [y]/n? y

Select a compiler: 
[1] Lcc-win32 C 2.4.1 in C:\PROGRA~2\MATLAB\R2012a\sys\lcc 
[2] Microsoft Software Development Kit (SDK) 7.1 in C:\Program Files (x86)\Microsoft Visual Studio 10.0 

[0] None 

Compiler: 2

Please verify your choices: 

Compiler: Microsoft Software Development Kit (SDK) 7.1 
Location: C:\Program Files (x86)\Microsoft Visual Studio 10.0 

Are these correct [y]/n? y

*************************************************************************** 
  Warning: MEX-files generated using Microsoft Windows Software Development  
           Kit (SDK) 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\JQ\AppData\Roaming\MathWorks\MATLAB\R2012a\mexopts.bat 
From template:              C:\PROGRA~2\MATLAB\R2012a\bin\win32\mexopts\mssdk71opts.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 at: 
           http://www.mathworks.com/help/techdoc/matlab_external/bsflnue-1.html 
           Building with the -largeArrayDims option enables the new API. 

After completing this step I'd magically hope my next call to 'CompileFeast.m' would be successful. Instead I receive:

>> CompileFEAST

  C:\PROGRA~2\MATLAB\R2012A\BIN\MEX.PL: Error: 'FSToolboxMex.c' not found. 

Error using mex (line 206)
Unable to complete successfully.

Error in CompileFEAST (line 3)
mex -I../MIToolbox FSToolboxMex.c BetaGamma.c CMIM.c CondMI.c DISR.c ICAP.c JMI.c
mRMR_D.c ../MIToolbox/MutualInformation.c ../MIToolbox/Entropy.c
../MIToolbox/CalculateProbability.c ../MIToolbox/Arr 

Same issue again! After further frustrations looking into the problem, one suggests using the dir function to see if the file is even in the directory (which it is not), see below:

>> dir 'CompileFEAST.m'
CompileFEAST.m not found.

To make sure I can see other files in my Matlab path, I check another function to see if its in the directory:

>> dir 'hurst.m'

hurst.m

As you can see this file is found in the directory. I simply provided the same procedure as adding the above toolbox to my Matlab working path, all I do is copy the file into the working path and add files or subfolders to the path.

Does anyone notice where I am going wrong? I am not very inclined at solving such problems, I more or less using Matlab as an on-the-go model building platform to understand algorithms.

I look forward to any comments.

Cheers, J

有帮助吗?

解决方案

I think your current directory (pwd) is wrong.

Try:

cd('E:\School\hidethis\hidethis\MATLAB work\FEAST\FEAST\FSToolbox')
CompileFEAST

其他提示

Even though you may think that FSToolboxMex.c is in your MATLAB path, it appears that it isn't.

  • What directory is FSToolboxMex.c in?
  • What is your current directory (the one from which you run CompileFEAST)?
  • What is your MATLAB path (use the path command)?
  • What does which -all FSToolboxMex.c return?
  • What does the code of CompileFEAST look like?

Using the 'pwd' command showed me that I was not in the same path as CompileFEAST.m. It was a simple as double-clicking and re-running the script. This may be a embarrassing for me but at least I've learned my error! Thanks all for the quick replies, greatly appreciated!

Best, J

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top