2.安装工具包 首先需要安装VC++,最好是2006以后的版本,我用的是2008,matlab版本最好也是新点的,我用的是2010b。然后启动matlab,将EMD工具箱添加到matlab路径中(File\SetPath),运行 mbuild -setup,出现
>> mbuild -setup
Please choose your compiler for building standalone MATLAB applications:
Would you like mbuild to locate installed compilers [y]/n? y
Select a compiler:
[1] Lcc-win32 C 2.4.1 in D:\matlab\sys\lcc
[2] Microsoft Visual C++ 6.0 in D:\Microsoft Visual Studio
[0] None
Compiler: 2
Please verify your choices:
Compiler: Microsoft Visual C++ 6.0
Location: D:\Microsoft Visual Studio
Are these correct [y]/n? y
Warning: MBUILD requires that the Microsoft Visual C++ 6.0
directories "VC98" and "Common" be located within the same parent directory.
(Expected to find these directories in 'D:\Microsoft Visual Studio'.)
Trying to update options file: C:\Documents and Settings\Administrator\Application Data\MathWorks\MATLAB\R2010b\compopts.bat
From template: D:\matlab\bin\win32\mbuildopts\msvc60compp.bat
Done . . .
3.然后运行install_emd.m
cemdc.c
cemdc.c(19) : fatal error C1083: Cannot open include file: 'complex.h': No such file or directory
D:\MATLAB\BIN\MEX.PL: Error: Compile of 'cemdc.c' failed.
D:\MATLAB\BIN\MEX.PL: Error: Compile of 'cemdc2_fix.c' failed.
Warning: The compilation of the following files failed:
> In make_emdc at 48
In install_emd at 26
cemdc.c
cemdc_fix.c
cemdc2.c
cemdc2_fix.c
Some errors occurred during compilation. See details above.
Installation complete. Run index_emd for a list of functions.
IMPORTANT: After running INSTALL_EMD you must run the "savepath" command to save the installation
but be careful that if you previously removed parts of the path (using e.g. the "rmpath" command)
these will be permanently removed after you run "savepath"
然后运行install_emd.m,会出现“cemdc.c(19) : fatal error C1083: 无法打开包括文件:“complex.h”: No such file or directory”类似这样的提示。这里我参考了G. Rilling 程序,安装没有complex.h解决方法!这个帖子提供的解决方法,将EMDS/make_emdc.m的第28行mex(’-DC99_OK‘,args(:))语句中的 '-DC99_OK' 去掉,然后在EMDs\src相应的头文件(clocal_mean.h和clocal_mean2.h)中加入M_PI的宏定义即可,在两个.h文件中分别加入以下语句:
#define CLOCAL_MEAN_H
#ifndef M_PI
#define M_PI 3.1415926
#endif %红色部分为添加的语句
最后运行install_emd.m,会提示安装成功Compilation successfull Installation complete. Run index_emd for a list of functions.安装完成后,EMDs文件夹中会出现.mexw32文件。