Error in compiled exe file using deploytool ("An error occurred while trying to determine whether normcdf is a function name")

8 次查看(过去 30 天)
I have compiled a standalone executable using deploytool.m in the Matlab Compiler Version 4.16 with Matlab R2011b. I get the following error whenever I run the compiled program (but not when I run the function from within Matlab):
"An error occurred while trying to determine whether "normcdf" is a function name"
Any ideas on why this might be occurring?
This link <http://www.mathworks.com.au/support/solutions/en/data/1-A4CIW9/index.html?product=CO&solution=1-A4CIW9> suggests that the error may be a licensing issue. If that is the case, can anyone explain that further? I have a license for the statistics toolbox (i.e., which contains normcdf). Is there a way around this error?
Thanks,
Dan

采纳的回答

Daniel
Daniel 2012-1-9
Compiling with mcc -m provides more information on the error message than contained in the log file created using the deploytool.
The full error is as follows:
"The file [Root]\toolbox\lightspeed\normcdf.m' is not in the applications expanded CTF archive at [directory]\Temp\Username\mcrCache7.16\EM_DDL1'. This is typically caused by calls to ADDPATH in your startup.m or matlabrc.m files. Please see the compiler documentation and use the ISDEPLOYED function to ensure ADDPATH commands are not executed by deployed applications.
An error occurred while trying to determine whether "normcdf" is a function name."
Removing ADDPATH calls from my startup.m file and compiling with mcc -m seems to have fixed the error.
  1 个评论
Titus Edelhofer
Titus Edelhofer 2012-1-9
My advice usually is to put those addpaths in your startup file into the following conditional:
if ~isdeployed
% this is MATLAB, not compiled application
addpath(...)
end

请先登录,再进行评论。

更多回答(1 个)

Walter Roberson
Walter Roberson 2012-1-9
In the routine that calls normcdf, try adding
%#function normcdf
I always have a hard time finding this in the documentation. It is at http://www.mathworks.com/help/toolbox/compiler/function.html

类别

Help CenterFile Exchange 中查找有关 Startup and Shutdown 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by