The tool "release_package_pcode" will package the main function <function_name> and its subfunctions together into one pcode "function_name.p" and also creates a help file(*.m) with just the user comments added in "function_name.m".
- <function_name> - Name of the main function that has to be distributed as pcode.
Output: <function_name>_release_<timestamp> release folder.
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.
- Converts the new file as pfile "<function_name>.p".
- Lists and copies all the "other files" pcodes, mex files and others that are called by <function_name>.m to the user.
- Copies the help comments from the "<function_name>" and prints the help comments to a file "<function_name>.m"
All files are placed in directory release_files_<date>. If the directory already available, then it overwrites it.
Now the "<function_name>.p" and "<function_name>.m" are the distributable to the other users along with the "other files".
Constraint: All functions should use either one of the closing command "return" or "end" uniformly between them. Else the function will stop the pcode conversion.
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 pcode tool as follows,
It will create a folder with the name "<function_name>_release_<timestamp>
Please share your comments and suggestions for any improvements.