Adding help content to AppDesigner App

13 ビュー (過去 30 日間)
Greg
Greg 2017 年 9 月 29 日
回答済み: Nicholas Ayres 2020 年 9 月 18 日
Does anybody know how to add comments to an .MLAPP such that "help myapp" returns the help content? Currently, all I get is "myapp is a class. [hyperlink]Reference page for myapp" The reference page is awesome, but my users like the standard help display.

回答 (3 件)

Greg
Greg 2017 年 10 月 10 日
編集済み: Greg 2017 年 10 月 10 日
According to Function Precedence, .mlapp files are above .m files. This means we can create an .m file with the same name as our App, and put the help content in that .m file.
The caveat is at the command window:
help MyApp
returns the not-so-helpful "MyApp is a class." However,
help MyApp.m
forces MATLAB to look at the .m file rather than the .mlapp, and displays the help desired. This shouldn't have any run-time side effects, and only puts a small burden on users to explicitly add the ".m" to the help command input.

Ramanuja Jagannathan
Ramanuja Jagannathan 2017 年 10 月 5 日
編集済み: Ramanuja Jagannathan 2017 年 10 月 5 日
I don't think the feature is currently available. The guess the reference page option (doc link below)available as of now.
https://www.mathworks.com/help/matlab/matlab_prog/display-custom-documentation.html

Nicholas Ayres
Nicholas Ayres 2020 年 9 月 18 日
From what I can tell, no.
Greg's workaround is one suggestion. Alternatively, I've decided to write a static help function in my class which basically just contains an fprintf statement of what I want my help file to say.
At least then you can access it via myApp.help

カテゴリ

Help Center および File ExchangeDevelop Apps Using App Designer についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by