Does MCC exclude 'csaps' function when generating standalone executable

1 view (last 30 days)
Hi all,
I have a C program written as mex file and use the Matlab csaps function in it. When I call the corresponding mexfunction, I get an error "Undefined function 'csaps' for input arguments of type 'double'". This happens when I generate a standalone executable using Matlab R2015a (v 8.5). However, if I use Matlab R2013b to generate the executable, the procedure containing 'csaps' function is not recognized and the error is "Invalid MEX-file, Path/to/file: The specified procedure could not be found".
Could you please help me or direct me to the proper documentation with relevant updates.
-- Thanks, Ram.

Accepted Answer

Walter Roberson
Walter Roberson on 14 Sep 2015
csaps is part of the Curve Fitting Toolbox. You need to have that licensed on the system you are using the MATLAB Compiler on.
You did not mention how you are invoking the MATLAB compiler. You might have to specifically mention csaps on the command line.

More Answers (2)

Steven Lord
Steven Lord on 14 Sep 2015
The Compiler Support table indicates that command-line functionality in Curve Fitting Toolbox is supported for use with MATLAB Compiler, so I would expect this to work if you were calling it from MATLAB code. But you're using mexCallMATLAB to invoke csaps from your MEX-file, correct?
In that case, I believe you're essentially running into the "Fixing Callback Problems: Missing Functions" section on the Troubleshooting page and explicitly adding csaps to your application may work. [I've never tried this, so I can't be certain that it will work.] I would try that and contact Technical Support for further advice if it doesn't.
  1 Comment
Ramaprasad Kulkarni
Ramaprasad Kulkarni on 14 Sep 2015
Your answer is more detailed, but since the solution to my problem of explicitly including csaps as part of mcc was pointed by Walter earlier to you, I had to accept his answer. I appreciate your answer.

Sign in to comment.


Ramaprasad Kulkarni
Ramaprasad Kulkarni on 14 Sep 2015
Thanks for your reply Walter and Steven. Since there is an overlap in the answers to both your comments/questions, I will reply here.
I have the license for Curve Fitting Toolbox and I confirmed this by running example 1 in the documentation of the function for csaps.
Here is my situation. Basically, I have a GUI developed in Matlab and I call Matlab and C functions (written as mex files) in the GUI for processing data. So I have a combination of Matlab (including .fig files) and C/mex files. And like Steven rightly pointed out, in one of those C files I invoke csaps using mexCallMATLAB. And I use deploytool to generate a standalone executable from all these Matlab and C files. I didn't see csaps being excluded in the mccExcludedFiles.log file that got generated at the end of compilation process, so I was not sure if this was a new thing in 2015.
I tried MCC with command line options to generate the executable and included csaps.m as part of the file list and it works. Same was the case with delpoytool when I explicitly include csaps.m file from the curvefit toolbox path (MATLAB\R2015a\toolbox\curvefit\splines\csaps.m).
I wonder why there was no need to include the csaps.m file explicitly with earlier compilers versions?
Thanks again for your time and helpful answers.

Products

Community Treasure Hunt

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

Start Hunting!