Say I have the following file structure:
+mypackage/
foo.m
bar.m
How can I add help to the output of help(mypackage)?
In python, I'd just add a docstring in __init__.py. What's the equivalent here?
Per MATLAB's toolbox distribution documentation, the MATLAB analog to Python's __init__.py docstring would be a help summary file.
Using the above folder structure, we can add a contents.m file to achieve the desired behavior:
+mypackage/
foo.m
bar.m
contents.m
Given a basic contents.m file:
% This is contents.m
% This package contains:
% bar - Bar things
% foo - Foo things
We achieve the following:
>> help mypackage
This is contents.m
This package contains:
bar - Bar things
foo - Foo things
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With