- Do you observe the above behavior with other Stats functions like nanmin, nanmax, etc, as well?
- Can you run the exe from inside MATLAB?
Matlab compiler and Statistics toolbox - error when running standalone application
3 次查看(过去 30 天)
显示 更早的评论
I am trying to compile a small function containing the nanmean function from the stats toolbox using the Matlab compiler. This does not work - it complains about an undefined function.
The function is simple:
function testNanmean
%#function nanmean
x = nanmean(randn(30))
and I compile it using
mcc -m testNanmean.m -d mexdir\
I install the MCR installer (C:\Program Files (x86)\MATLAB\R2014a\toolbox\compiler\deploy\win32\MCRInstaller.exe).
When I run the program I get the following output:
E:\Utvikling\WingFish\Matlab\mexdir>testNanmean.exe
Undefined function 'nanmean' for input arguments of type 'double'.
Error in testNanmean (line 4)
MATLAB:UndefinedFunction
Any idea on what is going wrong? And yes: The function works in Matlab. :-)
PS! The presence of the
%#function nanmean
line does not seem to change results.
2 个评论
Harsheel
2014-5-21
I tried the above example on my system (32-bit R2014a) and the exe when run against the 32-bit MCR, seems to work fine. It's weird that the function works in MATLAB.
>> !testNanmean.exe
3. To rule out that your ctfroot is corrupted, I'd probably try recompiling with -C (capital C) flag so that when I run the exe, it extracts to the same folder.
Roger Watt
2014-7-25
The issue applies to the whole stats toolbox. I am finding that you can work round this by creating local copies of the toolbox files you need and adding those to the required files list.
回答(1 个)
Roger Watt
2014-7-25
I get this as well. It doesn't matter whether I run the exe from windows or from the Matlab prompt. I also find that the compiler pragma doesn't have any effect. The -C option doesn't change it.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Introduction to Installation and Licensing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!