Code covered by the BSD License  

Highlights from
extracthelp

Be the first to rate this file! 2 Downloads (last 30 days) File Size: 3.07 KB File ID: #21431

extracthelp

by Andrey Popov

 

13 Sep 2008 (Updated 07 Nov 2011)

Extract the help information of all M function in a folder

| Watch this File

File Information
Description

extracthelp extracts the help lines of all .M files in the current folder and writes them in files (with corresponding names) in a sub-folder 'phelp'.

The function is very useful in combination with the 'pcode'. Whereas pcode creates a pre-parsed .P files, that can be distributed to users, that shouldn't have access to the original code, the .P files do not preserve the help information of the functions. The 'extracthelp' function does exactly this.

extracthelp % create the .\phelp folder and the help files for all files in the current folder
pcode *.m % convert all .M files to .P files
movefile('*.p','.\phelp') % moves the .P files to the \phelp folder the phelp folder contains the files you can now safely distribute

MATLAB release MATLAB 7.2 (R2006a)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (2)
03 Apr 2009 Sergiy

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

08 Nov 2011 Jan Simon

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.

Please login to add a comment or rating.
Updates
16 Sep 2008

Added functionality.

24 May 2009

License changed from GPL to BDS inside the M file.

12 Mar 2010

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

07 Nov 2011

Updated author information and file finctions

Tag Activity for this File
Tag Applied By Date/Time
p code Andrey Popov 22 Oct 2008 10:19:13
pcode Andrey Popov 22 Oct 2008 10:19:13
extract Andrey Popov 22 Oct 2008 10:19:13
help Andrey Popov 22 Oct 2008 10:19:13
utilities Andrey Popov 22 Oct 2008 10:19:13

Contact us at files@mathworks.com