Cannot generate method documentation for abstract class
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Daniele Lupo
am 8 Mai 2024
Kommentiert: Steven Lord
am 10 Mai 2024
I've the following abstract class:
classdef (Abstract) SessionManager < handle
% SESSIONMANAGER Interface for a generic session manager.
% The session manager has the responsibility to manage the sessions that
% are opened for the system. It also allows to perform some operation on
% them.
methods
b = isSessionOpened(this)
% ISSESSIONOPENED Tells if a session is currently opened in the system.
session = getCurrentSession(this)
% The comment for getting current session
loadSession(this, session)
% another comment
clearSession(this)
% You know what's this
end
end
When I try to retrieve the help of the class, I can see the description from the command line:
help SessionManager
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1689762/image.png)
But when I click on the link for seeing the documentation page. I cannot see the documentation for methods, they are blank:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1689767/image.png)
This is what I see when I click on a link of a custom method:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1689777/image.png)
What I'm doing wrong? How can I document properly the methods?
0 Kommentare
Akzeptierte Antwort
Animesh
am 8 Mai 2024
This seems to be an issue with the way you have declared your functions. The functions should be declared in the following format to generate proper help documentation:
function b = isSessionOpened(this)
% ISSESSIONOPENED Tells if a session is currently opened in the system.
end
You can refer the following MathWorks documentation for more information:
Hope this helps in resolving the issue.
4 Kommentare
Steven Lord
am 10 Mai 2024
You can have non-Abstract methods in an Abstract class.
In addition, if your class is defined in an @ directory specifying the method attribute Abstract can help MATLAB distinguish whether those methods are Abstract or defined in a separate file.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu MATLAB Compiler finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!