MATLAB: Does the MATLAB Compiler 4.9 (R2008b) not recognize Image Processing functions inside an RPT file

compilercompilingfileMATLAB Compilermbuildmccrpt;

I am trying to compile an application which uses an RPT file.
The application works without any issues while running it in MATLAB. However, when I try to run the executable built using the MATLAB Compiler, the compiled application is not able to recognize the Image Processing functions like IMSHOW and IMFILTER inside the RPT file.

Best Answer

This issue is because functions like IMSHOW and IMFILTER from the Image Processing Toolbox are not being added to the CTF archive of the compiled application.
There are two ways to workaround this issue:
1) Use of %# function pragma: It informs MATLAB Compiler that the specified function(s) should be included in the compilation, whether or not MATLAB Compiler's dependency analysis detects the function(s). So, include the following line in your MATLAB code and compile your program:
%#function imshow,imfilter
2) Use of -a flag in MCC command: While compiling your MATLAB code using the MCC command, add the Image Processing functions like IMSHOW and IMFILTER to the CTF archive using the -a option as follows:
mcc -m mfilename -a imshow -a imfilter