Compiled MATLAB GUIDE UI - Missing Functions

1 vue (au cours des 30 derniers jours)
Scott
Scott le 1 Fév 2012
Hi all,
I have developed an application in MATLAB consisting of a UI (developed using GUIDE) and some underlying functions invoked by callbacks from the main UI.
The export m-file generated by GUIDE for the UI is then compiled to generate an exe that clients can run using the MATLAB MCR.
I have a couple of questions relating to this process:
1. Is there still a requirement in MATLAB R2011b to use %#function definitions to identify all functions that your application is dependent upon for compilation purposes? I'm guessing there is, as I am getting a lot of 'missing function' error messages at runtime as a result of missing %#function statements.
2. Is there an easy way to determine all of the dependencies from a top-level GUIDE generated UI? I know of 'Tools-Show dependency report' but this does not work with m-files created using the GUIDE export function.
Thanks in advance for any response.
Cheers,
Scott

Réponse acceptée

Walter Roberson
Walter Roberson le 1 Fév 2012
The %#function pragma is needed in most GUIDE programs, because GUIDE codes its callbacks in terms of strings rather than in terms of function handles. The compiler is not able to find any dependency that appears only in a string.

Plus de réponses (2)

Image Analyst
Image Analyst le 1 Fév 2012
I've never done anything with "%#function" and my files compile just fine.
In addition to Dependency report, you can try fdep: http://www.mathworks.com/matlabcentral/fileexchange/17291 It seems to give a more complete report with tons of details (though you may not need all of them). There is also this one: http://www.mathworks.com/matlabcentral/fileexchange/14176-depfuntoolbox but I haven't tried it.

owr
owr le 1 Fév 2012
Like Image Analyst said above, in general the dependency search during compilation should be able to locate dependent functions. The only situation Ive run into where this can be an issue is if the functions you are calling are methods of MATLAB classes. In that case the %#function comes into play. See for example this solution:
Are your missing functions class methods?

Catégories

En savoir plus sur Migrate GUIDE Apps dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by