View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from

Be the first to rate this file! 3 Downloads (last 30 days) File Size: 3.48 KB File ID: #21431 Version: 1.4



Andrey Popov (view profile)


13 Sep 2008 (Updated )

Extract the help information of all M functions in a sub-folder

| Watch this File

File Information

extracthelp extracts the help lines of all M-files found int he current folder and writes them in corresponding files in a specified sub-folder.

The function is very useful in combination with the 'pcode'. The function pcode creates a pre-parsed P-files, that can be distributed to users who should not have access to the original code. However the P-files do not preserve the help information of the original functions. The 'extracthelp' function exports only the help information, thus allowing the users to use the 'help' function as usual.

extracthelp() % create the help M-files in a \phelp folder
pcode *.m % convert all .M files to .P files

The \phelp folder contains thus the files you can safely distribute.

MATLAB release MATLAB 7.2 (R2006a)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (2)
08 Nov 2011 Jan Simon

Jan Simon (view profile)

I'd prefer "mkdir(foldername)" instead of "eval(['mkdir ' folder_name])".
The "fclose('all')" is not helpful, if a file cannot be opened. There is also no reason to close all files in case of success, prefer "fclose(F)".
Under Linux (and as far as I can see under modern Matlab versions under Windows also) the file separators are CHAR(10). Therefore checking for 13 is not secure.
You use "ind" as loop index of two nested loops. Although this might works, it is recommended to avoid this.

Comment only
03 Apr 2009 Sergiy

Sergiy (view profile)

It doesn't seem to be compatible with UNIX, OSX. It needs changes from '\' to filesep and something else. As is, it generates error:
>> extracthelp
md phelp: Bus error

Comment only
24 May 2009 1.1

License changed from GPL to BDS inside the M file.

12 Mar 2010 1.2

Fixed bug by creating and accessing folders under Unix/Mac.

07 Nov 2011 1.3

Updated author information and file finctions

08 Jul 2013 1.4

- Bugfix;
- Updated help; Comments
- mkdir and movefile functions instead of "! md ..."

Contact us