Why am I unable to use the function IMTRANSFORM in an application created with MATLAB Compiler 7.10 (R2009a)?

2 views (last 30 days)
My program loads the transformation structure (TFORM) that is passed to IMTRANSFORM from a MAT file. The program runs fine within MATLAB but fails in compiled mode with the following error:
Warning: Could not find appropriate function on path loading function handle
C:\MATLAB\R2009a\toolbox\images\images\private\inv_piecewiselinear.mexw32>inv_piecewiselinear
Compiling the application using the MATLAB Builder JA shows the following additional information:
Exception caught: com.mathworks.toolbox.javabuilder.MWException: Error using ==> feval
Undefined function handle.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 15 Jul 2009
The TFORM structure contains a function handle to a function from the Image Processing Toolbox. Since the structure gets loaded at runtime, the static analysis that is done by the MATLAB Compiler fails to identify the file as a dependency.
To work around this issue, add the following "function pragma" line of code to the beginning of your MATLAB program to indicate that the function CP2TFORM should be included in the compilation:
%#function cp2tform
The function CP2TFORM will automatically include the rest of the files that are needed for the TFORM structure to be loaded/restored correctly from the MAT file.

More Answers (0)

Categories

Find more on MATLAB Compiler in Help Center and File Exchange

Products


Release

R2009a

Community Treasure Hunt

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

Start Hunting!