我想對我遇到的問題進行一步一步的故障排除。我想用我在http://www.cs.man.ac.uk/~gbrown/fstoolbox/找到的工具箱進行我在32位Matlab R2012a中進行的研究中的各種用途。這裏是我在Matlab中看到的錯誤,當使用'CompileFeat.m'腳本時,必須調用'CompileFeat.m'腳本來編譯C中設計的主要工具箱函數。當然,我將解壓後的文件夾複製到我當前的工作路徑中,並將所有文件夾添加到當前工作路徑。爲自定義MATLAB工具箱執行編譯器腳本時出錯
>> 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
因此,在谷歌上進行了一些挖掘之後,我看到很多建議要求我檢查是否安裝了編譯器。請看下面的代碼:
>> 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.
完成這一步我會神奇地希望我下次調用「CompileFeast.m」後會成功。相反我收到:
>> 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
同樣的問題再次!經過進一步的挫折尋找到這個問題,一個建議使用DIR功能,看文件即使在目錄(它不是),見下圖:
>> dir 'CompileFEAST.m'
CompileFEAST.m not found.
爲了確保我可以看到其他在我的Matlab的路徑的文件,我檢查其他功能,看看它在目錄:
>> dir 'hurst.m'
hurst.m
正如你可以看到這個文件在目錄中找到。我只是提供了與上述工具箱添加到我的Matlab工作路徑相同的過程,我所做的只是將該文件複製到工作路徑中,並將文件或子文件夾添加到路徑中。
有沒有人注意到我出錯的地方?我不是很傾向於解決這些問題,我或多或少地使用Matlab作爲一個移動模型構建平臺來理解算法。
我期待着任何意見。
乾杯, Ĵ
MATLAB正確地找到CompileFEAST.m。這不是問題。它沒有找到FSToolboxMex.c – Navan
感謝您的快速回復@Navan!正如@ am304在下面問的那樣,我如何檢查FSToolboxMex.c所在的目錄?如何檢查當前目錄是什麼?我對我的基本問題表示歉意,很多這種術語對我來說都是新鮮的...... – thatWaterGuy