MATLAB Answers

0

Using 'doc' on overloaded/overridden classes: Help only shows the Matlab class documentation

Asked by D. Plotnick on 26 Feb 2019
Latest activity Answered by Sreelakshmi S.B on 5 Mar 2019
Hello all,
I have what is hopefully a simple issue to remedy. I have created a custom class that turns out to overload some Matlab class. I have written extensive notes/help documents into this class, and want the user to be able to type ' doc myClass' and return my documentation; however, the help window only shows the Matlab version, and the "other uses" link does not include mine.
Additional considerations:
(1) I have ensured that the class is at the top of my Matlab path
(2) The class is in the folder @myClass/myClass.m
(3) I have tried using a different case convention (if Matlab has myClass.m and I have MyClass.m, it still only directs to myClass.m 's help page.
So, how do I get 'doc' to show my documentation, short of forever avoiding overloading Matlab built-in/toolbox function names (which is impractical).
Cheers,
-Dan

  0 Comments

Sign in to comment.

Products


Release

R2018b

1 Answer

Answer by Sreelakshmi S.B on 5 Mar 2019
 Accepted Answer

I don't think there's any quick way to do this .If you go through the 'Description' section of the documentation for doc- https://www.mathworks.com/help/releases/R2018b/matlab/ref/doc.html- you can see that the first check is for a MathWorks Reference page.
This is not the case for the help function.You can go through the documentation for help here:https://www.mathworks.com/help/releases/R2018b/matlab/ref/help.html
Of course,a possible workaround would be to modify the code for doc.m (use 'edit doc' in the matlab terminal after changing permissions) so that it checks for custom documentation first.May not be the best solution but it'll work.

  0 Comments

Sign in to comment.