Is it possible to automatically create help functionality for my standalone application from the comment block of the MATLAB function using the MATLAB Compiler?

2 views (last 30 days)
I am creating a standalone application. How do I create help functionality for my standalone application? Is there a way to automatically convert the help comment block of the MATLAB function into equivalent help functionality in the standalone application?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 7 Jun 2012
The functionality to automatically convert a MATLAB function help block into a standalone application help functionality is not supported in MATLAB Compiler. This functionality also does not exist in C/C++ shared library deployment.
As a workaround, you can use an if statement within the main function of the deployed application, to check whether the first argument to the function is equal to "-help" and then display an appropriate message to the screen. For example:
function out = foo(vargin)
if nargin==0 || (nargin==1 && strcmp(vargin{1},'-help'))
disp('HELP')
end
Alternatively, HTML help documentation is created automatically if you are compiling .NET assemblies or Java packages.
You can also use the DOC command to generate help documentation from your MATLAB files before compiling. If you have a function, say foo.m, and run the code below
doc foo.m
it will generate a file in the browser that takes the comments from the function and imports it into the help documentation. This is especially useful if you have a MATLAB class file, where it will import comments and details on each property and method in the class. The function
help foo.m
can also do the same thing, but display the output in the command window.

More Answers (0)

Categories

Find more on Manage Products in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!