The tool "publish_all_functions" extends the capability of the publish command to publish the main function and its subfunctions together into one document html/pdf/...
- <function_name> - Name of the main function that has to be published.
- Use the same syntax format of "publish" command for <options>.
1. >> publish_all_functions(<function_name>,'pdf').
2. >> opts.outputDir = 'C:\';
>> opts.format = 'html';
Here are activities done by this utility.
- Reads all the subfunctions of "<function_name>".
- Creates a new file with the name "<function_name>", and copies the main function and the all the subfunctions into this.
- Lists all the "other files" pcodes, mex files and others that are called by <function_name>.m to the user.
- Publish the new file.
All files are placed in directory publish_files_<date>. If the directory already available, then it overwrites the contents.
Constraint: All functions should use either one of the closing command "return" or "end" uniformly between them. Else the function will stop the publishing process.
Demo: Please download the files.
Add the “demo_development_folder” into MATLAB path. Browse the contents in the folders. 'main_sample_function' is the main function for this development folder. Call the publishing tool as follows,
It will create a folder “publish_files_<today_date>” with the “html” subfolder. Refer the “html” subfolder for the published files.
Please share your comments and suggestions for any improvements.
I have the same problem as Andres H. It looks like Matlab is busy but memory consumption increases slowly until I have to force to stop.
BTW Would be great if Mathworks could enhance the existing Publish function in some of the next updates to publish subfunctions along with the main function.
Anyway thanks for the effort in trying to enhance this functionality.
I've been trying to output a pdf file, but when I call the function, it just hangs, like it's working. The memory Matlab consumes slowly increases until I force the process to stop.
This runs perfectly for publishing all functions and nested functions. Only gone about three levels deep but so far.
There is a problem that it crashes MatLab when it tries to publish functions with PLOT's.
Plus a minor detail, the call function commands are a little hard to find in the documentation and are inconsistent in a few places.
After tinkering I found these worked:
Added screenshot to the file submission.
Edited the comments and description.