mexw64-files - MatCont package
조회 수: 17(최근 30일)
I've been trying the dynamical systems package MathCont to work on my PC (Windows 8, 64-bit), but somehow the mexw64 files aren't helping me. I downloaded them from
but running them in Matlab throws an error (see attached jpeg).
I should add that I am not familiar with mex-files of any sort, so maybe I am just making some 'obvious' mistake. Other blogs and Q&A's haven't helped so far.
Thanks for any sort of help! :)
Geoff Hayes 2014년 10월 27일
Daniel - you are correct in thinking that the MEX files are built from C (or C++ or Fortran) code that you can then call from your MATLAB programs. In your case, the MEX file that you are trying to run, BVP_BPC_jacC is built from the C function matcont5p4/LimitCycle/BVP_BPC_jacC.C. This file (and the others) are built when I type the following in the Command Window from the matcont5p4 (the version that I downloaded) folder
If I then change directory to matcont5p4/LimitCycle, I will see the C file and the MEX function (BVP_BPC_jacC.mexmaci64, since I am running MATLAB on a Mac). If I then try to run this function (like you), then I observe a crash as well.
This behaviour, while undesirable, is expected as the C code is making certain assumptions about its input parameters. Since you are not passing any, then the code tries to access data that doesn't exist and so crashes. (Some checks could have been added to make sure that the correct number of parameters were being passed before it tried to make use of the parameters.)
This MEX function (and the others) should only be called from within the context of the matcont software, and not outside of it (unless you know what inputs each expects).
Abhiram Bhanuprakash 2014년 10월 28일
편집: Abhiram Bhanuprakash 2014년 10월 28일
I am adding to what Geoff Hayes mentioned in his answer above.
Yes, you are right. MEX stands for MATLAB Executable, and this means that you can create a MEX file from a C/C++/Fortran code and run it in MATLAB. However, to do this, you would need to have a supported compiler, which in this case is Windows SDK 7.1.
To install Windows SDK 7.1, please refer to the article here
From the crash dump, I think you have two issues:
1. As Geoff said, you need to give input arguments to the MEX function which you call.
2. You need to have a suported compiler installed, and point MATLAB to it.
After installing Windows SDK 7.1, you can point MATLAB to use it, by entering the following line of code in your Command Window:
>> mex -setup